Material-ui: [Theme] objects bouncing on input change

Created on 28 Mar 2019  路  5Comments  路  Source: mui-org/material-ui

I have the next issue, and I'm not even certain that it is an bug or whatever, I need support and understanding :)

Imagine you have one input filed of the select type, something like
<TextField id="standard-select-currency-native" select ...
Then imagine you are watching the theme object passed from the MuiThemeProvider. If you inspect the previously mentioned TextField inside the ReactDevTools, you will see that the theme object is kinda _bouncing_.
What I mean by saying _bouncing_ is that you will see that all nested objects are appearing and disappearing (you must expand them, for instance see the onBlur inside the red square that I have provided in appended image).
image

So if you can, please explain is this normal, and why. Will it influence more unnecessary re-rendering and should I worry about it? Can I cure that issue?

performance incomplete

Most helpful comment

The theme object is immutable.

We don't seal or freeze it though. It's possible to mutate it. The components won't update though.

All 5 comments

Imagine you have one input filed of the select type, something

Could you add minimal example please? Preferable in a https://codesandbox.io.

I have tried but without success. If you follow this link -> https://material-ui.com/demos/text-fields/#textfield and you will change the selected item inside this component:
image
But, here is my concern if you inspect for instance any other nearby component that is near it like this one
image
And inspect its provided theme
image

and look at the theme object, and expand the properties of that theme object (mixins and palette)
image

And continue watching them, when you change the value of the nearby component previously mentioned (the one with the currency select), you will see that whole theme object is bouncing. And I'm wondering why is the Theme object changing or bouncing?

Is it because of the state change of the container component?

@dusanbass The theme object is immutable. I would look into the React dev tool.

The theme object is immutable.

We don't seal or freeze it though. It's possible to mutate it. The components won't update though.

I would look into the React dev tool
The components won't update though

Thank you for the clarifications and suggestions guys! :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mb-copart picture mb-copart  路  3Comments

zabojad picture zabojad  路  3Comments

chris-hinds picture chris-hinds  路  3Comments

rbozan picture rbozan  路  3Comments

activatedgeek picture activatedgeek  路  3Comments