Walk through how to add a route with props passed to the children component.
- [Instructor] In React, there will be many cases…where you need to pass prompts to a component…being rendered in the route.…For example right now we have our Home component…handling the state with the cards data.…Well, what if we had the cards data in the App component…and then pass these props into our own route?…This is what we'll explore so let's take a look.…So the first thing I want to do is remove the state…in the cards data here so let's do that…and then also remove at the top…the import data so let's remove that…so what we're doing is lifting the state up…to the main App.js component.…
The other thing I want to do is change this.state.cards…to props.card like so.…And finally, what we'll do is refactor this component…into a functional component or a stateless component…so we'll use the same shortcut we used before so sfc…and then what we'll do is call this one Home,…then do props pass props.…And then in the return statement,…we'll do parenthesis like this…and copy and paste div from div here so 15 to 25,…
- What is routing?
- How React Router can be used across different types of projects
- Web routing and native routing
- How to do URL params and dynamic routing
- Basic React Native routing
- Server-side rendering use cases
- Testing use cases