Animation withCallback, Value is undefined, expected an Object
See original GitHub issueDescription
I need to have a callBack after the animation ends But when I add withCallback, I have error modal Value is undefined, expected an Object
const animationEnd = SlideOutRight.withCallback((finished: boolean) => {
// other code
});
{!shouldAnimate && (
<Animated.View entering={SlideInLeft} exiting={animationEnd}>
<View />
</Animated.View>
)}
Expected behavior
a callBack after animation ends
Actual behavior & steps to reproduce
After state changes, animation starts and then error modal if withCallback was selected
Package versions
name | version |
---|---|
react-native | 0.64.3 |
react-native-reanimated | ~2.3.1 |
NodeJS | v14.18.0 |
expo | 44 |
Affected platforms
- Android
- iOS
- Web
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
React Native render error Value is undefined expected a object
Update your react-native-reanimated version.In my case I have react-native-reanimated version 2.3.1 and rolling back to 2.2.4 version.
Read more >Exiting Animations | React Native Reanimated
In React Native during unmounting of components from the hierarchy of views, it just disappears in the next frame. However you can beautify...
Read more >Conditional JavaScript Callbacks with Reanimated in React ...
In order to communicate back you need to use call which is a declared method that you provide a list of animated values...
Read more >React native - Can't dispatch action in component because ...
[Solved]-React native - Can't dispatch action in component because state gets undefined-React Native. Search. score:0. boards: state.boards.filter ((it) ...
Read more >Promise - The Modern JavaScript Tutorial
A promise is a special JavaScript object that links the “producing ... initially undefined , then changes to value when resolve(value) is ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, it was because I wasn’t enough attentive… So instead of the solution above, I did next
@fristyr I had this issue and solved it by declaring the callback function as a worklet then running my JS code with the runOnJS function