i am facing some issue how can i solve
Answered
Griffon Bleu de Gascogne posted this in #help-forum
Griffon Bleu de GascogneOP
i am declaring like this
import { Key } from "react";
const [selectedId, setSelectedId] = useState<Key>("");
import { Key } from "react";
const [selectedId, setSelectedId] = useState<Key>("");
Answered by rex1410
I was able to temporary fix by replacing import { Key } from 'react' with import { Key } from '@react-types/shared' as described.
14 Replies
@Griffon Bleu de Gascogne is your selectedKey prop of type
Key
from React?Griffon Bleu de GascogneOP
It's a type Key
its your custom type?
Griffon Bleu de GascogneOP
It's a useState
I am not talking about the state variable selectedId, I want to know what is the type of the prop selectedKey
Griffon Bleu de GascogneOP
I am using NextUi from there I took component.
@Griffon Bleu de Gascogne found the problem
this is a known bug in next ui
I was able to temporary fix by replacing import { Key } from 'react' with import { Key } from '@react-types/shared' as described.
Answer
use this ^
Griffon Bleu de GascogneOP
Ok
Thank you means a lot 😊
no worries!