i'm new to react, and i'm trying to pass data between two functional component without using any events handler like (onClick or onChange) In my child component
const Child = () => {
const [data, setData] = useState([]);
useEffect(() => {
fetchData().then(result => setData(result.dataArray));
}, []);
}
function App() {
return(
<Child />
)
}
For any Suggestions and help i will be grateful