If I loop over an array to create a list of components each of which uses a hook, does that break the only-use-hooks-at-the-top-level rule?
function Parent(props) {
const [arr, setArr] = useState([])
const components = arr.map((item, idx) => <Child key={idx} item={item} />)
return <>{components}</>
}
function Child(props) {
const [val, setVal] = useState()
return (
<>
//...
</>
)
}