component did mount react native functional component code example
Example: didMount in functional component
useEffect(() => { fetch(url) .then(resp => resp.json()) .then(data => this.setState() }, [])
useEffect(() => { fetch(url) .then(resp => resp.json()) .then(data => this.setState() }, [])