Pass Props to #react Router’s Link Component
▻https://hackernoon.com/pass-props-to-react-routers-link-component-2eebda7a63e1?source=rss----3a
Often times when building an app with React Router you’ll need to pass props through a Link component to the new route. In this post, we’ll break down how that process works.▻https://medium.com/media/eb462541b0d3521ddc9fc898011a053d/hrefThere are two different ways to pass data from a Link component through to the new route that’s being rendered. The first is through URL Parameters and the second is through state.First, let’s take a look at URL parameters. If you’ve read our URL Parameters post, you’ll be familiar with this example. Say we were in charge of building out the Route that renders Twitter’s profile page. If created with React Router, that route may look like this<Route path=’/:handle’ component=Profile />Notice that handle is going to be dynamic. It could be anything (...)
#react-router #javascript #web-development #software-development