react-spring-bottom-sheet: TypeError: Cannot read properties of undefined (reading 'getValue')
I’m using your great module on my all projects but i couldn’t implement to new one.
I got this error when “open state” to true. -> “TypeError: Cannot read properties of undefined (reading ‘getValue’)”
my dependencies: “react-spring-bottom-sheet”: “^3.4.0”, “next”: “12.1.4”, “react-dom”: “18.0.0”,
Code:
const [open, setOpen] = useState(false)
return (
<>
<button onClick={() => setOpen(true)}>Open</button>
<BottomSheet open={open}>My awesome content here</BottomSheet>
</>
)
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 22
- Comments: 34
It seems to be working in
3.5.0-alpha.0it’s working fine on me, maybe try to remove the node_modules folder then run npm install again?
my package.json “react”: “18.2.0”, “react-dom”: “18.2.0”, “react-spring-bottom-sheet”: “3.5.0-alpha.0”,
Ran into the same issue, looks like it’s a issue with React v18 StrictMode, removing StrictMode or running a prod build it works fine. https://reactjs.org/blog/2022/03/29/react-v18.html#new-strict-mode-behaviors
it worked by disabling the react strict mode on nextjs 13.
Well the package here is locked to version 8 API, so it probably needs a good update to be working with react18 & react-spring9
Id try talk to the maintainer or update the lib and submit a PR.
Same here, latest version (3.4.1) on react 18 still triggers the same issue. Running on NextJS if that helps
@joshuaellis I have gone ahead and made the changes needed to upgrade to
react-springv9.4.5Haven’t tried it yet, but this seems similar https://github.com/roman-rr/cupertino-pane
I still have the issue with the last version, any ideas ?
I actually launched a new version of react-spring that works with r18, so I think this project would need to update its deps accordingly 👌🏻 9.4.5 for reference.
i guess still no solution for this issue i’m having this issue as well on nextjs 13
Thanks joshuaellis, I uninstalled the react-spring-bottom-sheet package and re-installed it. Then checked the react-spring version and is now the 9.4.5 you mentioned; but I still getting the same error: TypeError: Cannot read properties of undefined (reading ‘getValue’). The error is in the localhost only, in production works fine.
Did I missed something else that you can help me please?