Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Warning | validateDOMNesting For Helper Ref #51

Open
GoPro16 opened this issue Jan 25, 2020 · 1 comment
Open

Warning | validateDOMNesting For Helper Ref #51

GoPro16 opened this issue Jan 25, 2020 · 1 comment

Comments

@GoPro16
Copy link
Contributor

GoPro16 commented Jan 25, 2020

Currently if a user wants to override the tag prop of react-block-ui they can but it doesn't account for warnings that may come up if per say we were to have a tag of <tbody>

Example Code:

<BlockUI tag="tbody">
   <td>hello</td>
</BlockUI>

rendered HTML

<tbody>
   <td>hello</td>
   <span />
</tbody>
Warning: validateDOMNesting(...): <span> cannot appear as a child of <tbody>.

Code Link

I would suggest the we move the span ref helper out of the component and return BlockUI as a fragment of both. Then we can just have the span grab the same element from helper.previousSibling to allow any tag to be overridden for the BlockUI tag prop.

@djejaquino
Copy link

Came here to report the same. This looks very ugly in the console.

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

No branches or pull requests

2 participants