0

Is this even possible? the question here has answers that allude to the server rendering as explained in the docs.

But if we wanted to make that same counter example, but our App included libraries that don't support server rendering (the window is not an object sadness), how can we pass initial state from query string?

Azeli
  • 698
  • 7
  • 16
  • I think you can avoid re-rendering if your do not subscribe to the store. – 10101010 Apr 11 '19 at 15:13
  • You can store your saved serialized state into a global variable and assign get it when initializing redux. If your backend does not serve directly react you can make an HTTP request to your server before bootstrapping React app – Mosè Raguzzini Apr 11 '19 at 15:45
  • I need to be able to pass query params to client as initial state but I do not need to do any other rendering server side. `foo.com/?form=23&user=11` – Azeli Apr 11 '19 at 15:55
  • You can access the query string with JavaScript and dispatch and action to store that data. Do not subscribe to that reducer to avoid re-rendering. – 10101010 Apr 12 '19 at 03:30
  • not sure I understand what you are saying. store the data where? i need to pass that data back to client with initial page load. – Azeli Apr 12 '19 at 13:27

0 Answers0