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

Block Editor: Warning when rendering InnerBlocks #20069

Closed
aduth opened this issue Feb 6, 2020 · 4 comments · Fixed by #20082
Closed

Block Editor: Warning when rendering InnerBlocks #20069

aduth opened this issue Feb 6, 2020 · 4 comments · Fixed by #20082
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Bug An existing feature does not function as intended

Comments

@aduth
Copy link
Member

aduth commented Feb 6, 2020

Describe the bug

A warning is logged in development environments when a Columns block (or presumably any block with InnerBlocks) is rendered.

react-dom.8b3dda97.js?ver=16.9.0:539 Warning: React does not recognize the `hasPopover` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `haspopover` instead. If you accidentally passed it from a parent component, remove it from the DOM element.

To reproduce

Steps to reproduce the behavior:

  1. Navigate to Posts > Add New
  2. Insert a Columns block
  3. Open Developer Tools Console and observe warning

Expected behavior

No warnings.

Additional context

Introduced in #19922.

Fix is to avoid applying prop to Container when Container is assigned as 'div'.

const Container = rootClientId ? 'div' : RootContainer;

<Container
ref={ ref }
className={ classnames(
'block-editor-block-list__layout',
className
) }
hasPopover={ __experimentalUIParts.hasPopover }
>

cc @yansern, @ockham

@aduth aduth added [Type] Bug An existing feature does not function as intended [Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P labels Feb 6, 2020
@ragnarokatz
Copy link
Contributor

@aduth Hello, I would like to give this issue a try please.

@ragnarokatz
Copy link
Contributor

@aduth Hello, I have created a PR to address this issue. Please review it when you have time. Thanks.

@yansern
Copy link
Contributor

yansern commented Feb 7, 2020

@aduth Thank you for catching that issue and @ragnarokatz thank you for getting to this swiftly.

@ockham
Copy link
Contributor

ockham commented Feb 7, 2020

Sorry, missed that in my review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Nested / Inner Blocks Anything related to the experience of nested/inner blocks inside a larger container, like Group or P [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants