Skip to content

Instantly share code, notes, and snippets.

@jordic
Created December 5, 2019 08:53
Show Gist options
  • 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