Created
November 1, 2018 08:26
-
-
Save theham3d/ded1ecb09fc5ea673594ed41ba7250b5 to your computer and use it in GitHub Desktop.
useEffect Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
class ClassComponent extends Component { | |
componentDidMount() { | |
fetchSomething(); | |
} | |
render() { | |
return <div>شیب، بام؟</div>; | |
} | |
} | |
const FunctionComponent = props => { | |
useEffect(() => { | |
fetchSomething(); | |
}); | |
return <div>شیب، بام؟</div>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment