When I run this component, both effects are being called. How to prevent the second one from being called on component mount?
const Item = ({route, navigation, ...props}) => {
const [page, setPage] = useState(0)
useEffect(() => {
console.log('component mount')
//call API with page 0
//call another API
}, [])
useEffect(() => {
console.log('called', page)
//call API with page {page}
}, [page])
console.log('render')
return (
<Text>test</Text>
);
}