Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

React - Syntax error: 'return' outside of function

0 votes
20 views
added 5 days ago in React by lcjr Second Warrant Officer (5,360 points)
// wrap the return<> inside the function
function functionWrapper() {
  
  const facebook = () => {
    window.open(
      `http://facebook.com/sharer.php?u=${window.location.href}`,
      '_blank',
    );
  };
  
  return (
    <>
    // your content goes here
    </>
  );
}

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...