Reanimated warning on set state
I get the following warning whenever I setState in the component that the CalendarContainer is being rendered (anything that triggers a rerender):
[Reanimated] Reading from valueduring component render. Please ensure that you do not access thevalueproperty or useget method of a shared value while React is rendering a component.
I'm getting this too.
"dependencies": {
"@howljs/calendar-kit": "2.2.1",
"react": "18.3.1",
"react-native": "0.76.5",
"react-native-gesture-handler": "2.21.2",
"react-native-reanimated": "3.16.3",
...
},
I am getting this too
@howljs may we know if this will be addressed?
The current solution: set strict to false (https://docs.swmansion.com/react-native-reanimated/docs/debugging/logger-configuration)
import {
configureReanimatedLogger,
ReanimatedLogLevel,
} from 'react-native-reanimated';
configureReanimatedLogger({
level: ReanimatedLogLevel.warn,
strict: false,
});
@howljs I am aware of this and I appreciate the response, but that's more so covering up the problem than solving it. Do you have any idea what may be causing the warning, and whether you foresee a fix soon?
@howljs Agree with @rithik-raja that simply turning off the configuration will be duck-taping over a potentially insidious bug.
Any application that uses react-native-reanimated will be using it for more than one UI control, for example we use it for all our TouchableOpacity controls.
Causing race conditions(what the above looks like) might affect any other parts of the app that uses react-native-reanimated might be affected too.
@ArindamRayMukherjee since you're mentioning race-conditions: I'm getting this error after upgrading to the latest kalendar-kit. Related?
ERROR Your app just crashed. See the error below.
java.util.ConcurrentModificationException
java.util.ArrayList$Itr.next(ArrayList.java:860)
com.swmansion.gesturehandler.core.GestureHandlerOrchestrator.onHandlerStateChange(GestureHandlerOrchestrator.kt:105)
This happens when swiping to tomorrow on any android emulator I spin up. I am also geting the aforementioned warning from reanimated.
@tedvangageldonk Possibly related but can't say for sure. I use the ios simulator and then test for Android on a real device. The crash is probably the simulator not being able to handle the race condition. Maybe it doesn't crash on a real Android device?
hi, would you mind if I ask what your react-native-screen version? @ArindamRayMukherjee I am getting a crash when I try to swipe right with these dependencies.
"dependencies": {
"@howljs/calendar-kit": "2.2.1",
"react": "18.3.1",
"react-native": "0.76.6",
"react-native-gesture-handler": "^2.23.1",
"react-native-reanimated": "^3.16.7",
"react-native-screens": "^4.8.0",
}
@basaksilasanli I'm at 4.3.0
Also facing this issue; Any update on this @howljs ? Do you need contributors?