My application has a theme (colors and styles) delivered using the REST API. Whenever a theme changes on the server, the application receives a notification through a socket connection to receive a new theme through REST.
The theme is loaded into Redux itself, and the colors are saved both in the Redux repository (to enable saving to disk) and in the "global" singleton object that I can use everywhere, that is, even unconnected components.
When a new theme arrives, I want to redisplay every element of the application. I managed to redo all the components associated with the repository in a hacker key - by entering a dummy property that changes when a new topic changes.
Is there a way for the forceUpdate
whole application?
Problem areas:
dumb components (not familiar with topic changes)
truly intelligent components (store aware, but not aware that they are not redirecting in vain)
Here's an example of a hacker force-re-render reaction-navigation:
myAppContainer.render() {
<AppRouter
screenProps={this.props.styling}
/>
}
those. my appcontainer gets this.props.styling
through mapStateToProps
. Wrapped StackNavigator
gets this through screenProps
, which causes the navigator to re-display when the store receives new simulation data.
I do not want to continue this hacker path. Instead, I need a function forceUpdateEverything()
that I could call from mine AppContainer
. Is there such a thing?
Edit the comment for the answer from @bennygenel:
I think Benny describes, in essence, what I did. Changing this.props.styling causes a re-rendering.
"" , . , , , .
immutable.js, , , .
forceUpdate() , , . , .