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
It's incorrect to reassign the state value before return statement, every reassignment will trigger a recomposition even no component reference this state value.
The text was updated successfully, but these errors were encountered:
Especially for high-frequency collected data, I cannot skip recomposition to optimize performance, such as using lambda expressions to pass data, which causes the phone to overheat severely.
A good way is to put the logic (before the return statement) in the state holder, and also put the sensor data in the state holder. Then exposed rememberXXX like this:
Every rememberXXXSensorState has performance issue, here is demo:
Any state will trigger infinite recomposition, which is not correct. I found the issue comes frome here:
It's incorrect to reassign the state value before return statement, every reassignment will trigger a recomposition even no component reference this state value.
The text was updated successfully, but these errors were encountered: