Skip to content

Themr breaks shouldComponentUpdate shallow equal optimization #26

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

Merged
merged 4 commits into from
Oct 1, 2016
Merged

Conversation

istarkov
Copy link
Contributor

@istarkov istarkov commented Sep 26, 2016

Add failing test showing #25

@istarkov
Copy link
Contributor Author

Add fix.

@istarkov
Copy link
Contributor Author

ThemeProvider enforces a single child error was before my commit.

Copy link
Contributor

@raveclassic raveclassic left a comment

Choose a reason for hiding this comment

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

To recall #25 I should note that I don't see any reasons of including these changes because IMO it's not responsibility of themr to handle pure-rendering out of the box.

: this.getThemeNotComposed(props)
}

componentWillReceiveProps(nextProps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How do you handle context here? Seems like component won't react on changing its theme in context. Even without pure-rendering optimization.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

After breif dicussion with @istarkov it seems that ThemeProvider should have some kind of notification mechanism to notify themed components about context changes. This is out of scope of this PR.

@raveclassic
Copy link
Contributor

Here's a quickfix

@javivelasco javivelasco merged commit d1144ae into javivelasco:master Oct 1, 2016
@raveclassic raveclassic mentioned this pull request Oct 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants