r/reactjs•
Trunkhead

Getting html on a page from a nested route generated from an external json

I'm parsing info from an external JSON that populates users names. When i click on the user name it needs to take me to a page w/ the rest of the JSON info about that user. I've got the route generated but it's just taking me to a blank page

<Link to={/users/${id}} target='_blank'>{dynamicData.name}</Link>}

routes me to http://localhost:3000/users/0 which is blank.

any help would be appreciated, thanks

Posted Aug 21, 2018, 3:59 PM UTC · edited

12
mtaon•

Does it work if you remove target='_blank'?

It seems your web server is not configured to redirect everything to index.html.

1
TrunkheadOP•

No that makes no difference.

this is my first attempt at a React application. I have the route information on the APP.js then i have new pages for the users, posts, etc. each page calls a different external JSON package. so the /users page populates with all list of all the names from it's json. they should link to /users/:id which would display the entire json object

so the code i showed earlier is on the <Users /> page

1