Update getInj.ts to read inj object from window.__DRPRUINJ__, if host document has no meta-tag with similar itemprop (the usual source of data injected from the server-side), and if such object is attached to the window.
Don't forget to remove it from the window once it is received!
Update documentation for client() method (client-side init function), to mention that it is normally handles injected data received from server, and it can be worked around differently for distinct environments by attaching data to be injected to the window, prior to loading anything from react-utils lib.
Currently it requires
client.setInj()
, with a custom client-init code in the host project. It was a hotfix solution. It should be re-considered, and presumably improved. https://github.com/birdofpreyru/react-utils/blob/15a0a030d1863485de8e411b001ab816302d43fb/docs/docs/api/functions/client.md?plain=1#L16-L25On the second thought, here is the plan:
Revert the previous take, https://github.com/birdofpreyru/react-utils/commit/15a0a030d1863485de8e411b001ab816302d43fb
Update getInj.ts to read
inj
object fromwindow.__DRPRUINJ__
, if host document has no meta-tag with similaritemprop
(the usual source of data injected from the server-side), and if such object is attached to the window.Don't forget to remove it from the window once it is received!
Update documentation for
client()
method (client-side init function), to mention that it is normally handles injected data received from server, and it can be worked around differently for distinct environments by attaching data to be injected to the window, prior to loading anything from react-utils lib.