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

#1628 - componentWillReceiveProps() receives undefined instead of default #1711

Merged
merged 1 commit into from
Jul 17, 2018

Conversation

mykhailo-riabokon
Copy link
Contributor

@mykhailo-riabokon mykhailo-riabokon commented Jul 11, 2018

Fix for #1628

@mykhailo-riabokon mykhailo-riabokon changed the title #1654 - setProps overwrites props when component is shallow mounted #1654 - componentWillReceiveProps() receives undefined instead of default Jul 11, 2018
@mykhailo-riabokon mykhailo-riabokon changed the title #1654 - componentWillReceiveProps() receives undefined instead of default #1628 - componentWillReceiveProps() receives undefined instead of default Jul 11, 2018
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test passes for me without your implementation fix - additionally, it passes with <Foo /> and with <Foo className={notUndefined} /> (since I might expect the setProps to be a noop when the prop value is the same as previously).

Are you sure this is still a bug?

@ljharb ljharb force-pushed the master branch 2 times, most recently from 568ebdd to 0ee548f Compare July 17, 2018 22:34
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've rebased this, removed the unnecessary fix, and added tests for mount as well.

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

Successfully merging this pull request may close these issues.

2 participants