04. useEffect πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

In this activity, we will practice using the useState and useEffect Hooks in React by transforming a stateful class component into a functional component with React Hooks.

Instructions

  • Replace your React application’sΒ srcΒ folder with starter/src.

  • If you created a new React app, you will need to install Axios and React Router.

  • Start the application in dev mode by running npm start in your terminal.

  • Open your browser toΒ localhost:3000Β and study the rendered application.

  • Update this application to accomplish the following:

  • In pages/Search/index.js, create a functional component in place of the class component.

  • Replace this.state and all instances of this.setState using the useState Hook.

  • Replace all component lifecycle methods with their Hook counterparts.

  • Remove the search button and utilize the useEffect Hook to query every time the user inputs anything into the search bar.


βœ… Solutions

Solutions Click Here