You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it would be nice if forceRefresh were configurable, even after instantiation.
The particular use case that I am envisioning is for gracefully forcing clients to update their versions. We periodically check to see if the current client is outdated and if so, it would be nice to make the next click on a link reload the application.
Another reason I think this would be nice is that <BrowserRouter>, in the react-router library, has a flag that can be toggled, but has no impact after instantiation. This makes the component uncontrolled, unfortunately. This would be an argument for making all configurations toggle-able.
I don't know what the API would look like. But, to keep it generic and re-useable across the different APIs, perhaps we want something like history.setConfig('forceRefresh', true) or history.setConfig({ forceRefresh: true }).
Thoughts?
The text was updated successfully, but these errors were encountered:
forceRefresh isn't something that should change over time. Either you need to get a new page from the server when the URL changes or you don't.
Having said that, there are ways to work around this if you need them. For your use case you can just not use forceRefresh and use window.location.reload when the user clicks your link.
It would make sense for my use case: in some pages of our website we let advertising partners inject ads. Basically we load a script from them so they have full access to our website to make changes (I know it sucks but it's how it's traditionally done).
The problem is that we don't know what they might do so I'd like to be able to refresh the page only when the user was on a modified page, to make sure the page is properly cleaned up.
lockbot
locked as resolved and limited conversation to collaborators
Jun 4, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I think it would be nice if
forceRefresh
were configurable, even after instantiation.The particular use case that I am envisioning is for gracefully forcing clients to update their versions. We periodically check to see if the current client is outdated and if so, it would be nice to make the next click on a link reload the application.
Another reason I think this would be nice is that
<BrowserRouter>
, in the react-router library, has a flag that can be toggled, but has no impact after instantiation. This makes the component uncontrolled, unfortunately. This would be an argument for making all configurations toggle-able.I don't know what the API would look like. But, to keep it generic and re-useable across the different APIs, perhaps we want something like
history.setConfig('forceRefresh', true)
orhistory.setConfig({ forceRefresh: true })
.Thoughts?
The text was updated successfully, but these errors were encountered: