Skip to content

Delay to switch themes #212

Closed Answered by jpudysz
RiczCalixto asked this question in Q&A
Discussion options

You must be logged in to vote

It just one big re-render of your app. If eg. your root component has useStyles, entire app will re-render. Same goes if you have mounted FlatList with hundreds of components and each consist of next components with useStyles.

This is how React works 🤷‍♂️ try to limit the number of mounted hooks while switching the themes, otherwise it will look like this.

I was debugging such case on discord for someone and it appeared that this dev had mounted FlatList with ~80 components each with ~12 hooks, so app was re-rendering 1000 components while switching themes. That's only FlatList.. and what about headers, tab bars and other screens.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RiczCalixto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants