Can anyone explain to me how Routing works in Reactjs?
browserHistory.push('/location') only updates the URL bar and doesn't redirect to it. browserHistory.goBack() works but only when the page has been visited before, hence the name. Which makes it difficult for me to understand how will browserHitory.goForward() work?
I have been trying to redirect to dashboard after a successful login. That's it.
From what I have read, React doesn't allow reloading a page. it will show a cannot GET /path error if we try to refresh the page or write the address in the url; unless the request is made on the server. I tried to create routes on server, but cannot get the syntax as to how I achieve it. I have only coded in Node to the extent of sending res.send() to the client app. How do I render that path? Because rendering to that path would mean that the Node's App.js has the view engine of the React app. I don't know if it's clear enough, but any advice would be helpful. Thanks.
via Amrita Sharma
No comments:
Post a Comment