[BUG] useChakraSelectProps not working
Description
When using useChakraSelectProps on freshly installed next js and latest chakra ui resulting error
useContext returned undefined. Seems you forgot to wrap component within <ChakraProvider />
chakra-react-select Version
6.1.0
Link to Reproduction
https://codesandbox.io/p/github/JenangMaker/test-bug-chakra-select
TypeScript?
- [ ] Yes I use TypeScript
Steps to reproduce
- Create fresh next js template
- install chakra ui
- install chakra react select
- create a select with useChakraSelectProps
Operating System
- [ ] macOS
- [x] Windows
- [ ] Linux
- [ ] iOS/iPadOS
- [ ] Android
Package Manager
NPM
Additional Information
Using
- ChakraUI 3.17.0
- chakra-react-select 6.1.0
- NextJS 15.3.1
I took a look, and I think there's something wrong with your sandbox environment. I can't tell exactly what it is, but I can't reproduce the issue when I set up my own instance of Next.js locally. I tried it specifically using the Chakra UI Next.js Pages example. One thing that does appear to be missing in your sandbox is the next-themes provider, which CRS uses to pull the styles from, but I'm not sure if that's the only thing, because adding that didn't seem to fix the issue for me.
I'll take another look later when I have time.
I'm having a similar issue. Interestingly, if i navigate from a page that doesn't have a select input to a page that does I don't get an error. It's only if I go directly to the page with the select or reload the page that the error pops up.
@JacobGalati Is it only for useChakraSelectProps, or just for the normal Select component?
There have been no new updates on this, so I'm going to close it until someone else has an issue with this