Hi folks, I have been using react for awhile but I am still not familiar with how routing works in react. For example, I am using switch, BrowserRouter, and Route to do dynamic routing for my small blog website project. And the detailed blog page got a URL such as “https://appName/blog/${blogId}“, everything seems to be working pretty well until I tried to copy and paste the URL to a new tap and suddenly nothing shows up (it works if I go from “https://appName/blog” ). (None of the components worked before show up in the new tab)
How should I approach to fix this?
I used redux to store all my blogs and use the useSelector hook to grab the blog with matched id when I go to the detailed blog page.
I want to learn more about how this works and any advice would be appreciated, thanks!
submitted by /u/sunnyUknowWhat
[link] [comments]