avishain / react-native-range-slider-expo

Customizable range slider for react native apps
MIT License
29 stars 12 forks source link

Invalid Hook call when installing on Expo SDK39 #9

Closed nsbingham closed 3 years ago

nsbingham commented 3 years ago

I'm getting the following error when attempting to use the RangeSlider.

Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
    at resolveDispatcher (react.development.js:1590)
    at useState (react.development.js:1618)
    at RangeSlider.tsx:47

I'm using the example code in the README.md.

<RangeSlider
    min={5}
    max={25}
    fromValueOnChange={(value) => setFromValue(value)}
    toValueOnChange={(value) => setToValue(value)}
    initialFromValue={11}
/>
<Text>from value: {fromValue}</Text>
<Text>to value: {toValue}</Text>

Thanks for any help!

BobTape commented 3 years ago

Hi, same issue, when i try this component.

avishain commented 3 years ago

Can you please show me (paste here) lines 40-50 of RangeSlider.tsx? you can find it in VScode by pressing F12 while standing on the imported component: image

pqthinh commented 3 years ago

hello, I also have the same issue RangeSlider.tsx image

avishain commented 3 years ago

I fixed the problem. Please try to reinstall the package and let me know if it was solved for you.

avishain commented 3 years ago

Hi, was the problem solved after reinstalling?

Osmanyteam commented 3 years ago

Hey, i had the same problem but after reinstalling it works.

avishain commented 3 years ago

Glad to hear. Thanks for the update.