JavaScript FrameworksReact

DELETE One Item From a List in React (Two Parts)

Part 2: For this exercise, we’re going to refactor what we did in Part 1 and move the flight list table to a child component. We’ll then pass the flight data as props to the child component to render. We also pass the deleteFlight() function to the child component in order for it to send data back up to the parent to update the state.

The final state of our root component.

App.js

The final state of the child component. We’ve created two additional child components.

FlightList.js
Verified by MonsterInsights