Skip to content

Instantly share code, notes, and snippets.

@jordic
Created December 5, 2019 08:53
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 jordic/9d7436425ebfe29316ebcaabf744a20f to your computer and use it in GitHub Desktop.
Save jordic/9d7436425ebfe29316ebcaabf744a20f to your computer and use it in GitHub Desktop.
React
const MyFunctionnalComponent: React.FC = props => {
useEffect(() => {
// Using an IIFE
(async function anyNameFunction() {
await loadContent();
})();
}, []);
return <div></div>;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment