Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 0, _reactNativeSkia.useClockValue is not a function (it is undefined) #2807

Closed
zahidalidev opened this issue Dec 15, 2024 · 1 comment

Comments

@zahidalidev
Copy link

I encountered a TypeError while using the @shopify/react-native-skia package in my React Native project. The error occurs when attempting to use the useClockValue hook. The error details are:

TypeError: 0, _reactNativeSkia.useClockValue is not a function (it is undefined)

The project is set up with the following key dependencies:

  • react-native: 0.73.2
  • expo: ~50.0.0
  • @shopify/react-native-skia: 1.7.3

Reproducible Code:

import { useClockValue } from '@shopify/react-native-skia';

// Inside my component
const clock = useClockValue(); // Throws the TypeError

Project Environment:

  • React Native version: 0.73.2
  • Skia version: ^0.1.196
  • Expo version: ~50.0.0
  • Node version: [your version]

Steps to Reproduce:

  1. Create a new React Native project with the following dependencies:
    • react-native: 0.73.2
    • expo: ~50.0.0
    • @shopify/react-native-skia: ^0.1.196
  2. Import the useClockValue hook from @shopify/react-native-skia into your project.
  3. Attempt to initialize the hook in a React Native component.
  4. Run the project and observe the TypeError.

Expected Behavior:
The useClockValue hook should initialize without errors and return the current clock value.

Actual Behavior:
The app crashes with the error:

TypeError: 0, _reactNativeSkia.useClockValue is not a function (it is undefined)

Additional Context:

  • I verified that the package is installed correctly by running npm ls @shopify/react-native-skia.
  • The package seems to include the useClockValue export in its documentation, but it appears to be undefined at runtime.
  • My package.json includes the following relevant dependencies:
"@shopify/react-native-skia": "1.7.3",
"react-native": "0.73.2",
"expo": "~50.0.0"

Questions/Requests:

  1. Is the useClockValue hook supported in the latest version of @shopify/react-native-skia?
  2. If this is a bug, are there plans to address it?

System Information:

  • Node version: v21.7.3
@wcandillon
Copy link
Contributor

useClockValue is no supported since more than a year now, we use Reanimated now for animation: https://shopify.github.io/react-native-skia/docs/animations/animations

I hope this helps and that you can nicely migrate to the latest version of RN Skia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants