Skip to content

noWrapper prop isn't used #44

Open
@nathnhughes

Description

@nathnhughes

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions