Open
Description
Not sure if this lib is still being maintained as there hasn't been much activity in a while but i've come across an issue when using the noWrapper
prop.
When doing something like:
<LazyHydrate whenIdle noWrapper="nav">
/* ...complex component ... */
</LazyHydrate>
the tag specified in noWrapper
is ignored and just the children are returned.
I've put together an example repo here: https://codesandbox.io/s/strange-napier-6tvbp4?file=/src/App.tsx
From a quick look over the code, my guess is it has something to do with the if statement on line 168:
react-lazy-hydration/src/index.tsx
Lines 168 to 170 in 8faafaa
It looks like that's checking whether noWrapper
exists rather than whether its actual value is true
...
if (noWrapper) { // here noWrapper could be string or true
return children;
}
but the problem may be deeper than that.
Metadata
Metadata
Assignees
Labels
No labels