rafgraph / spa-github-pages

Host single page apps with GitHub Pages
https://spa-github-pages.rafgraph.dev
MIT License
3.83k stars 565 forks source link

this.props.location.state is undefined when I refresh page #28

Closed ShinHyunJong closed 5 years ago

ShinHyunJong commented 6 years ago

First of all Thanks for your amazing solution. I am not sure about reason of this issue but whenever I refresh page I lost all of this.props.location.state objects. Funny thing is that it works on my local but location.state doesn't preserve on published page. Do you have any idea? thanks

rafgraph commented 5 years ago

It's because location.state is saved in memory and not saved in the url. When you refresh the page the app reads from what's in the url. Note that this is not a spa-github-pages specific thing.