export const Foo = () = {
const [toggle, setToggle] = useState(false);
render (
<div onClick={() => setToggle(!toggle)}>Скрыть компонент</div>
{toggle ? null : <Baz />}
)
}
let arr = [1, 2, 3, 4, 5]
function getConsoleLog(arr){
for (const i = 0; i < arr.length; i++){
return console.log(arr[i])
}
}
getConsoleLog(arr);