Skip to content

Conversation

@NinjaBanjo
Copy link
Member

This is a breaking change

consumers need to hook up the ThemeProvider to their own Themer class reference to get custom themes.

the default theme still works out of the box with no change

render() {
const { themer, children } = this.props
const { tick } = this.state
return <ThemerContext.Provider value={{ themer, tick }}>{children}</ThemerContext.Provider>
Copy link
Collaborator

Choose a reason for hiding this comment

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

technically you don't need to pass tick here, because you're already creating a new object every time this render() method runs, which will happen after you setState. Context doesn't do deep comparisons to determine if the value has changed, it's referential.

dmatteo
dmatteo previously approved these changes Mar 25, 2021
Copy link

@dmatteo dmatteo left a comment

Choose a reason for hiding this comment

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

LGTM tho I think Nathan is correct if you want to remove the tick trick (ha!)

Copy link

@dmatteo dmatteo left a comment

Choose a reason for hiding this comment

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

Sweet!

@NinjaBanjo
Copy link
Member Author

published 0.0.157-prerelease.1 for now because of blocking pr, and this is p0

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.

4 participants