Closed AnishDe12020 closed 2 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/timc/kbar/FQSTwh8qEzRJLHUqH4HhsqsjsWkh
✅ Preview: https://kbar-git-fork-anishde12020-fix-add-react-18-support-timc.vercel.app
Hey @timc1, thanks a lot for merging this!
It would be cool if you could also push these changes as a release to the registry as the current release is still old (25 days old as of writing) and the problem still persists if we try to use it.
This is available in the latest release 👍
Should we also add React 18 to package.json -> peerDependencies?
Right now, an npm install
fails with the following error if one's using React 18 along with kbar.
One can shut it up with npm i --legacy-peer-deps
, but that's not a good practice.
Closes #199
As stated in this comment on the issue, with React 18, to accept the
children
prop, the props interface must be wrapped withPropsWithChildren
.I have done the same for
KBarProvider
,KBarAnimator
, andKbarPositioner
. All typescript errors should be gone.I have tested this by synlinking the package and using it in one of my projects. There were no errors when building (it is a Next.js app using typescript)