Handle recursion loop in mappers #1685
karol-bisztyga
started this conversation in
Ideas
Replies: 1 comment
-
This might be a great point to suggest creating an ESLint plugin. There are a few cases where an AST-aware ESLint plugin would be a huge help at compile time:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We should somehow detect recursion loops in mappers and let users of the library know that they're going in a bad direction in terms of code design. Sample code:
Not all of the users are aware what are the mappers and how they work, therefore we should provide at least warnings that can be seen outside.
Mappers are currently used in:
useAnimatedStyle
useDerivedValue
useAnimatedReaction
- this case is a bit different, the hook was introduced also as a workaround to those infinite loops. Still, they may occur when inreact
the user modifies shared values that are used inprepare
, so we should as well handles such a case.Beta Was this translation helpful? Give feedback.
All reactions