react-portal-universal icon indicating copy to clipboard operation
react-portal-universal copied to clipboard

Critical: Concurrent renders

Open CosticaPuntaru opened this issue 6 years ago • 4 comments

on the server side there can be more then one requests at the same time being processed,

the const portals = []; at the file level will be shared between requests, and the output won't be what is expected.

in order to work properly the portals array needs to be sandboxed per request.

CosticaPuntaru avatar Sep 03 '18 09:09 CosticaPuntaru

@CosticaPuntaru That's a valid point, thanks. It would be better when the first call of appendUniversalPortals would create a scope limited to the single request and then inject the markup.

MichalZalecki avatar Sep 09 '18 12:09 MichalZalecki

I'm a fan of this, but perhaps add a big fat disclaimer not to use this until this issue is fixed? Only saw this by chance and it's a dealbreaker tbh.

MioQuispe avatar Sep 29 '18 21:09 MioQuispe

@MioQuispe Sure, thanks.

MichalZalecki avatar Sep 30 '18 17:09 MichalZalecki

@MichalZalecki Maybe this is helpful: https://jeremygayed.com/making-head-tag-management-thread-safe-with-react-head-323654170b45 https://github.com/tizmagik/react-head

I would help you out otherwise but I'm suuuper busy atm

MioQuispe avatar Oct 04 '18 20:10 MioQuispe