question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

useSharedValue hook throws errror

See original GitHub issue

Description

useSharedValue hook throws “Object.values requires that input parameter not be null or undefined”

Screenshots

Screen Shot 2020-09-02 at 00 37 43

Snack or minimal code example

const offset = useSharedValue(1);

Package version

  • React: 16.13.1
  • React Native: 0.62.2
  • React Native Reanimated: 2.0.0-alpha.5

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jakub-gonetcommented, Sep 2, 2020

Firstly, try cleaning project with:

If that doesn’t help try deleting xcode build artifacts & node_modules

If none of that will work please post the entire function (with dependencies, so if you’re using any variable, include it as well in the snippet) or better, create sample code on which you can repro this.

Closing for now.

0reactions
Terfendercommented, Oct 4, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

why useSharedValue can use in here? · Issue #1512 - GitHub
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. The text was updated successfully, ...
Read more >
Testing error: useSharedValue is not a function while testing
I'm using react-native-reanimated and when I'm testing, useSharedValue throws an error that it's not a function when using jest and ...
Read more >
useSharedValue | React Native Reanimated - Software Mansion
Use this hook to create a reference to a JavaScript value that can be shared with worklets. Shared Values serve a similar purpose...
Read more >
How to fix React Error: Rendered fewer hooks than expected
First, double check that you're not calling hooks within a conditional statement. The Hooks documentation makes clear that we are to use hooks ......
Read more >
react-native-reanimated useSharedValue TypeScript Examples
useState(0); const currentX = useSharedValue(-1); const currentY ... if (typeof source === 'undefined') { throw new Error( 'ImageTransformer: either source ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found