Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react useeffect async

const MyFunctionnalComponent: React.FC = props => {
  useEffect(() => {
    // Using an IIFE
    (async function anyNameFunction() {
      await loadContent();
    })();
  }, []);  
  
  return <div></div>;
};
Source by modern-javascript.fr #
 
PREVIOUS NEXT
Tagged: #react #useeffect #async
ADD COMMENT
Topic
Name
9+3 =