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:
|
if (noWrapper) { |
|
return children; |
|
} |
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.
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
noWrapperprop.When doing something like:
the tag specified in
noWrapperis 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
noWrapperexists rather than whether its actual value istrue...but the problem may be deeper than that.