-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Needs reviewIssue is ready to be reviewed by a maintainerIssue is ready to be reviewed by a maintainerPlatform: AndroidThis issue is specific to AndroidThis issue is specific to AndroidRepro providedA reproduction with a snippet of code, snack or repo is providedA reproduction with a snippet of code, snack or repo is provided
Description
Description
Another way to create a worklet should be with createWorklet function, but it's undefined.
Expected behavior
createWorklet shouldn't be undefined
Actual behavior & steps to reproduce
- createWorklet is undefined
- Import and use createWorklet to reproduce
Snack or minimal code example
import React from 'react';
import {StyleSheet} from 'react-native';
import Animated, {createWorklet, runOnUI} from 'react-native-reanimated';
const App = () => {
const workletCallback = createWorklet((a: number, b: number) => {
return a + b;
});
runOnUI(() => {
const res = workletCallback(1, 1);
console.log(res);
})();
return <Animated.View style={styles.container} />;
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'blue',
},
});
export default App;
Package versions
name | version |
---|---|
react-native | 0.66.2 |
react-native-reanimated | 2.2.3 |
It also affects latest version 2.5.0
Affected platforms
- Android
- iOS
- Web
Not tested on iOS and Web.
wanderSX
Metadata
Metadata
Assignees
Labels
Needs reviewIssue is ready to be reviewed by a maintainerIssue is ready to be reviewed by a maintainerPlatform: AndroidThis issue is specific to AndroidThis issue is specific to AndroidRepro providedA reproduction with a snippet of code, snack or repo is providedA reproduction with a snippet of code, snack or repo is provided