I'm building a HOC component in our library that basically wraps a shadow root component of this library. Putting this component in our story book I have a story book control to allow changing between the mode 'open' vs closed. Within a useEffect at parent level, I can't access any children within the shadow tree. There seems to be a multiple cycles redering happening that that the parent level is not aware of. Putting a setTimeout do the thick, but I bet there is a better fix that could be done inside the library or maybe I'm using it wrong. The shadow root seems to be there first render when useEffect runs, but the children not yet populated.
I'm building a HOC component in our library that basically wraps a shadow root component of this library. Putting this component in our story book I have a story book control to allow changing between the mode
'open'
vsclosed
. Within auseEffect
at parent level, I can't access any children within the shadow tree. There seems to be a multiple cycles redering happening that that the parent level is not aware of. Putting a setTimeout do the thick, but I bet there is a better fix that could be done inside the library or maybe I'm using it wrong. The shadow root seems to be there first render when useEffect runs, but the children not yet populated.Basically when I do:
I suspect would it be related to that ?