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

Duolingo Example useSharedValue cannot be called inside a callback. #171

Open
bourkison opened this issue Jun 26, 2022 · 0 comments
Open

Comments

@bourkison
Copy link

When trying to build my offsets array by including:

const offsets = children.map(() => ({
    order: useSharedValue(0),
    width: useSharedValue(0),
    height: useSharedValue(0),
    x: useSharedValue(0),
    y: useSharedValue(0),
    originalX: useSharedValue(0),
    originalY: useSharedValue(0),
  }));

in WordList.tsx, I get the below eslint error:
React Hook "useSharedValue" cannot be called inside a callback. React Hooks must be called in a React function component or a custom React Hook function.

Any clue how to work around this error?

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

1 participant