Skip to content

Instantly share code, notes, and snippets.

@theham3d
Created November 1, 2018 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theham3d/ded1ecb09fc5ea673594ed41ba7250b5 to your computer and use it in GitHub Desktop.
Save theham3d/ded1ecb09fc5ea673594ed41ba7250b5 to your computer and use it in GitHub Desktop.
useEffect Example
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