export const GetInputValue = (props) => {
const value = props.value;
return (
null
);
};
export function Items(props) {
const temp = [];
const howMuchTimes = (times) => {
for (let i = 0; i < times; i++) {
temp.push(i)
};
};
howMuchTimes(!!Здесь должно быть значение переменной value!!);
return (
<div className="items-list">
{temp.map((e) => <Item key={Math.random() * 9999} itemStyle={{
background: '#fff',
width: '140px',
height: `${Math.floor(Math.random() * (850 - 10) + 10)}px`,
margin: '0 .2rem'
}} />)}
</div>
)
}
GetInputValue
через рендер-пропсы получает состояние из другого компонента, const value
- в этой переменной записано то состояние, и вопрос как передать его в компонент Items
?