I want to create a single dynamic component that displays data from a json file dependant on the url. Instead of manually creating and storing each page.
For example: https://jsonplaceholder.typicode.com/posts
on page route: /1
the page would display:
Title = unt aut facere repellat provident occaecati excepturi optio reprehenderit
Body = quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto.
How would I return specific data from the json? Here's a quick fiddle: https://jsfiddle.net/pb2tL7ma/
Any suggestions would be appreciated!
react-routerto your app, then you can access those parameters based on theRoute