react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Cannot read property 'useSharedValue' of undefined

Open ZeroPie opened this issue 2 years ago • 0 comments

Description

new nativeeventemitter() requires a non-null argument
TypeError: Cannot read property 'useSharedValue' of undefined

Screenshot 2022-04-26 at 17 16 02

Screenshot 2022-04-26 at 18 09 17

Expected behavior

useSharedValue works

Actual behavior & steps to reproduce

"react-native-reanimated": "^2.8.0",
"react-native": "0.66.1",
module.exports = {
  presets: ['module:metro-react-native-babel-preset', 'module:react-native-dotenv'],
  plugins: [
    [
      'module-resolver',
      {
        root: ['./src/'],
      },
    ],
    'react-native-reanimated/plugin',
  ],

Snack or minimal code example

import { useSharedValue } from 'react-native-reanimated';

export default function Home() {
  
  const width = useSharedValue(50);
 ...
  return (
    <>
        ...
    </>
  );
}

Package versions

name version
react-native ^0.66.1
react-native-reanimated ^2.8.0
NodeJS 16.13.1
Xcode 13.1
Java 8.0.292.hs-adpt
Gradle 7.4.1
expo ---

Affected platforms

  • [ ] Android
  • [x] iOS
  • [ ] Web

ZeroPie avatar Apr 26 '22 23:04 ZeroPie