Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noWrapper prop isn't used #44

Open
nathnhughes opened this issue May 19, 2022 · 0 comments
Open

noWrapper prop isn't used #44

nathnhughes opened this issue May 19, 2022 · 0 comments

Comments

@nathnhughes
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant