react-cmdk
react-cmdk copied to clipboard
Example from README is not working
Im using create react app v5.0.1 with react v17.0.2 and getting
Hi, do you mind posting a reproducible repository or a code sandbox?
@albingroen not sure whats the difference (except sandbox is JS and local is TS) here but I couldn't reproduce it over there https://codesandbox.io/s/angry-gauss-rcz3j8?file=/src/App.js
Im not sure why I getting this error but maybe a bit of a research on what is the root cause of such an error can help us here
@albingroen not sure whats the difference (except sandbox is JS and local is TS) here but I couldn't reproduce it over there https://codesandbox.io/s/angry-gauss-rcz3j8?file=/src/App.js
Im not sure why I getting this error but maybe a bit of a research on what is the root cause of such an error can help us here
I think it might be a React 18 issue. The sandbox seems to be using v17. Which version are you using?
@albingroen Getting the exact same error here on React 17.0.2. Will try to reproduce in sandbox.
@albingroen Getting the exact same error here on React 17.0.2. Will try to reproduce in sandbox.
Are you using create-react-app?
@honzasusek Yeah, version 5.0.0
+ typescript 4.6.2
.
Im using create react app v5.0.1 with react v17.0.2 and getting
@albingroen just mentioned it in the initial comment.
I assume that the issue comes from parts in the code that are not backward compatible with react 17 ... let us know if we can help ... and thanks 🙏🏽
For some weird reason, it works in codesandbox but not locally. Just tried downloading the zip and running it, but I'm running in to the same issue...
@albingroen any progress here? do you need help?
@albingroen any progress here? do you need help?
Not really any progress. Would love some help!
@albingroen Not sure if this will help, but I just copied the package contents over to our repo, fixed the imports and it seems to be running just fine like that. Could this be a build-related issue? That might explain why codesandbox is working fine with the same setup.
@albingroen Not sure if this will help, but I just copied the package contents over to our repo, fixed the imports and it seems to be running just fine like that. Could this be a build-related issue? That might explain why codesandbox is working fine with the same setup.
Hmm, that sounds really weird...
@honzasusek Do you mind putting up that repo or inviting me to it so I can see it?
@albingroen I'm afraid that isn't possible, but I think I could at least share our tsconfig.json
, package.json
+ a general outline of our setup over PM.
@honzasusek Alright, you can DM me here
@albingroen no twitter account, sorry, sent you an email instead 👴
I was able to reproduce on a simple CRA project:
npx create-react-app my-project --template typescript
yarn add react-cmdk
yarn start
Then add the code from the readme into the app.
Also, I'm adding these tags so people will find this issue easily:
Uncaught TypeError: Cannot read properties of undefined (reading 'Child')
Having same issue with React 18 on local machine. It is not working and throwing
Uncaught TypeError: Cannot read properties of undefined (reading 'Child')
It seems there is an ongoing discussion about React 18 and Transition component compatibility. I see react-cmdk using Transition component. Check the details here.
https://github.com/tailwindlabs/headlessui/issues/681
I don't have the capacity to solve this, unfortunately, so I will close this for now :/
facing the same issue as well, also was working on codesandbox