0

Is it true, that each of exists browsers always will reload page completely if I change the query parameters in the address bar?

If it's true I suppose, that I can rely at componentWillMount, because page always will be completely refreshing, but if it's false, should I prefer to process changes in the address bar in the componentWillReceiveProps?

nitrovatter
  • 931
  • 4
  • 13
  • 30
  • 1
    Both componentWillMount and componentWillReceiveProps are deprecated, and it's recommended not to use these lifecycle methods anymore. – Keith Brewster Nov 19 '18 at 16:03
  • I know, but it's too expensive to switch to the new approach now. But in any case, how should I manage changes of query parameters now? – nitrovatter Nov 19 '18 at 16:05
  • @nitrovatter updates to the query parameters can occur from the `history` API / Object as well. In that case the page is not reloaded. Just some events are fired so the page can react to the changes. For example run `history.replaceState(null, null, '/?someparam=5')` in your console and see what happens in the url. – Gabriele Petrioli Nov 19 '18 at 16:18

0 Answers0