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

Loading a new theme does not update components that return false on shouldComponentUpdate #5691

Closed
dzearing opened this issue Jul 26, 2018 · 4 comments · Fixed by #6268
Closed
Assignees
Milestone

Comments

@dzearing
Copy link
Member

dzearing commented Jul 26, 2018

We are seeing with the new styled helper that they will pull the theme from context. However, if the contextual theme mutates, we aren't getting re-rendered when components are hosted within a parent which avoids a re-render (like List). This ends up breaking scenarios where we chose a live theme and expect the page to render with that theme.

Proposal:

We effectively make the theme observable (through change callback) and allow styled components to observe and repaint when needed.

It's not perfect, and I hate the word "observable". We need to research why something depending on context isn't repainting.

It might be resolvable with the new context, I'm not 100% sure if the problem only exists in legacy context.

Codepen repro:
https://codepen.io/dzearing/pen/PeNrzB

@dzearing
Copy link
Member Author

Moving to React 16 context.
Observing global customization changes (from loadTheme) and triggering a re-render for Customizers (NOT for individual components. We just need Customizer's provider to reevaluate what its providing.)

@dzearing
Copy link
Member Author

dzearing commented Aug 8, 2018

We're blocked on enzyme updating to consume the new react context.

@phkuo
Copy link
Contributor

phkuo commented Aug 15, 2018

@dzearing Is there an ETA on this? It would be great if we could get this in by the end of August.

@micahgodbolt micahgodbolt added the Status: Blocked Resolution blocked by another issue label Aug 30, 2018
@micahgodbolt
Copy link
Member

waiting on converting layer over to portals before we can make this switch, otherwise we lose theming in anything inside a layer. Layer conversion is happening at #4849

@micahgodbolt micahgodbolt added this to the Backlog milestone Aug 30, 2018
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants