Closed guanacone closed 4 years ago
i haven't done this exact thing before but this is a pretty good summary of the options you have:
https://css-tricks.com/how-to-the-get-current-page-url-in-gatsby/
i'd probably recommend something like method 2 from that article and then use a regular expression to extract the id from the url
Pretty much what I came up. Does my app really need that feature? What are the use cases of an user not following a link to access the edit page?
I think it's not too much more work and will also help when you want to have other pages link to the user page. This way anywhere can link to it and it centralizes the code that dynamically fetches the user details when the page loads
Happy to keep discussing this further if you or an article you find on it has other thoughts
Yesterday you mentioned that the actual Implementation of
edit-user
only works if I navigate from theuser-profile
to the edit page and that I should grab the ID from the url. How exactly would I achieve that?props.location
provides thepathname
which is a string andsearch
that would be a query string. Thanks for the hint