DEV Community

Discussion on: How to use componentWillUnmount with Functional Components in React

Collapse
 
robmarshall profile image
Robert Marshall

If you don't need anything to fire on component unmount, you can remove the return.

  useEffect(() => {
    getLevel();
  }, []);