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've been using react-gateway for years because of it's support for SSRing and it's been great, however I've recently run into a bug where the component does not render if the GatewayDest is declared before the Gateway. e.g.
// This does *not* server side renderconstApp: React.FunctionComponent<any> = ({}) =>{return(<><GatewayDestname="foo"/><Gatewayinto="foo"><div>Hello World</div></Gateway></>);};
// This does server side renderconstApp: React.FunctionComponent<any> = ({}) =>{return(<><Gatewayinto="foo"><div>Hello World</div></Gateway><GatewayDestname="foo"/></>);};
When you think about it this makes perfect sense as, in the first example, the gateway destination isn't aware of the gateway component as it's not yet rendered.
I think it's taken me this long to discover this issue because 99% of my use-cases have been to render modals or tooltips etc. which have always lived at the bottom of the page, however I'm now using it to render a notification banner at the top of the page which causes this issue.
Honestly, although I haven't looked into the code, I expect this would be quite challenging to fix but would be interested to hear otherwise?
If it's a "won't fix", perhaps you'd accept a PR to update the docs with this limitation?
The text was updated successfully, but these errors were encountered:
richardscarrott
changed the title
Server side rendering (SSR) fails when GatewayDest is rendered before the Gateway component
Server side rendering fails when GatewayDest is declared before the Gateway component
Feb 26, 2021
I've been using react-gateway for years because of it's support for SSRing and it's been great, however I've recently run into a bug where the component does not render if the
GatewayDest
is declared before theGateway
. e.g.When you think about it this makes perfect sense as, in the first example, the gateway destination isn't aware of the gateway component as it's not yet rendered.
I think it's taken me this long to discover this issue because 99% of my use-cases have been to render modals or tooltips etc. which have always lived at the bottom of the page, however I'm now using it to render a notification banner at the top of the page which causes this issue.
Honestly, although I haven't looked into the code, I expect this would be quite challenging to fix but would be interested to hear otherwise?
If it's a "won't fix", perhaps you'd accept a PR to update the docs with this limitation?
The text was updated successfully, but these errors were encountered: