You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.)
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
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 (likeList
). 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
The text was updated successfully, but these errors were encountered: