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

Components package: deprecated lifecycle method warning in slot-fill #9017

Closed
vindl opened this issue Aug 15, 2018 · 3 comments
Closed

Components package: deprecated lifecycle method warning in slot-fill #9017

vindl opened this issue Aug 15, 2018 · 3 comments
Assignees
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Comments

@vindl
Copy link
Member

vindl commented Aug 15, 2018

The components package is using the deprecated componentWillUpdate lifecycle method which produces console warnings when executed in React strict mode.

componentWillUpdate() {
if ( ! this.occurrence ) {
this.occurrence = ++occurrences;
}
const { getSlot = noop } = this.context;
const slot = getSlot( this.props.name );
if ( slot && ! slot.props.bubblesVirtually ) {
slot.forceUpdate();
}
}

Warning: Unsafe lifecycle methods were found within a strict-mode tree:
    in Editor (created by _class)
    in _class (created by RemountOnPropChange(_class))
    in RemountOnPropChange(_class)
    ...

componentWillUpdate: Please update the following components to use componentDidUpdate instead: Fill

cc @youknowriad @gziolo

@vindl vindl added the [Package] Components /packages/components label Aug 15, 2018
@youknowriad
Copy link
Contributor

This one is probably not the easiest one to replace because I believe the "order" of which the fills get added is important. So I'm pinging @aduth he knows more about that.

@designsimply designsimply added the [Type] Bug An existing feature does not function as intended label Aug 15, 2018
@aduth
Copy link
Member

aduth commented Aug 15, 2018

Order is important, yes. I'll give it a look, and if there aren't tests already, will add them in the fix.

@aduth aduth self-assigned this Aug 15, 2018
@vindl vindl changed the title Components package: deprecated lifecycle method warning Components package: deprecated lifecycle method warning in slot-fill Aug 15, 2018
@aduth
Copy link
Member

aduth commented May 28, 2019

As I understand, this was fixed as of #15541.

@aduth aduth closed this as completed May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants