Skip to content

Hot-reload with query string #3000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MichaelDeBoey opened this issue Aug 24, 2017 · 2 comments
Closed

Hot-reload with query string #3000

MichaelDeBoey opened this issue Aug 24, 2017 · 2 comments

Comments

@MichaelDeBoey
Copy link
Contributor

MichaelDeBoey commented Aug 24, 2017

Hi there!

I was wondering if it's possible to use a query string with the hot-reload?

Right now if I go to http://localhost:3000, my app will check if the mandatory GET parameters are present.
If so, the app will continue.
If not, the app will show an error.

So what I'm trying to do is going to http://localhost:3000?param1=value1&param2=value2.
When I than chance the code, the app hot-reloads I lose the GET parameters (and my whole (Redux) state also 😕).

Is there a way to keep the query string (or to keep my state) on hot-reload?

@cryptoquick
Copy link

I'm having this same exact issue. Whenever I load my app with a query string, the server strips that query string. It normally wouldn't be a huge issue except that I'm trying to get query string parameters from a redirect. Lots of services and apps do this, and developing on CRA breaks this.

@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

This is not related to CRA.

I created a new app and opened http://localhost:3000/?test. Then I edited src/App.js. The app reloaded at http://localhost:3000/?test.

All we do is call location.reload(). It wouldn't erase the query string. It's your code that's doing it somewhere.

@gaearon gaearon closed this as completed Jan 8, 2018
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants