Next.js Discord

Discord Forum

react-select type issue

Unanswered
Sun bear posted this in #help-forum
Open in Discord
Sun bearOP
I realize this isn't the "ideal" place to ask about a random react library, but I'm having no luck with anywhere else and I'm getting desperate. Does anyone have experience with react-select who can tell me what I'm doing wrong here? It functionally works, but throws "Type 'unknown' is not assignable to type 'Option'." As far as I've been able to determine, it's because react-select types multiselect options as MultiValue<unknown>, and if you explicitly pass it an object it throws a fit. But if you pass it without casting it as an object, you can't do anything with the object because ts says "this isn't an object, it's unknown" https://gitlab.com/-/snippets/4911457

0 Replies