![]() Src > components > Navigator.js file will return all the Link codes. Link tags will have a to attribute that will act like a path attribute in the Route tag. Like said before we have to use the Link tag to implement the links. Link tags are used to show navigational links in the UI. Im going to use that parameter to make a call to the GitHub API and retrieve my data. In order to dynamically get the content from the URL - in this case, taniarascia - well use from the props. To implement the Navigational links we have implement the Link tag. To use react-router-dom, we need to wrap our entire App component in BrowserRouter. But still now we redirecting the page through URL, not from the navigation links. We have implemented the Route, Switch, Error page. To handle the Error Page we have added one new component under src > components > Error.js.īy adding that component in Route tag without specifying any path, we will navigate to that component if the URL not matched with our other Route paths. Import React from 'react' import export default App
0 Comments
Leave a Reply. |