ink-select-input
ink-select-input copied to clipboard
React.createElement: type is invalid
Using a fresh install of https://github.com/vadimdemedes/create-ink-app
, installing ink-select-input, and running the demo from the README generates the following error:
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
The above error occurred in the <Demo> component:
in Demo (created by App)
in div (created by Box)
in Box (created by App)
in App
in App
Check the render method of `Demo`.
at createFiberFromTypeAndProps (/node_modules/react-reconciler/cjs/react-reconciler.development.js:16627:21)
at createFiberFromElement (/node_modules/react-reconciler/cjs/react-reconciler.development.js:16650:15)
at reconcileSingleElement (/node_modules/react-reconciler/cjs/react-reconciler.development.js:5302:23)
at reconcileChildFibers (/node_modules/react-reconciler/cjs/react-reconciler.development.js:5362:35)
at reconcileChildren (/node_modules/react-reconciler/cjs/react-reconciler.development.js:7865:28)
at mountIndeterminateComponent (/node_modules/react-reconciler/cjs/react-reconciler.development.js:8629:5)
at beginWork$1 (/node_modules/react-reconciler/cjs/react-reconciler.development.js:9938:16)
at Object.invokeGuardedCallbackImpl (/node_modules/react-reconciler/cjs/react-reconciler.development.js:11563:10)
at invokeGuardedCallback (/node_modules/react-reconciler/cjs/react-reconciler.development.js:11740:31)
at beginWork$$1 (/node_modules/react-reconciler/cjs/react-reconciler.development.js:15778:7)
Same problem
Something weird in the way it's bundled. I haven't had a chance to dig in. But if you're requiring, then you can do: const SelectInput = require('ink-select-input').default
@deshiknaves is correct, it's exported via default
prop for non-ESM imports.
Looks like it isn't configured to output ESM and is outputting ES6 instead Doing this works (although TypeScript is giving errors as if it was ESM)
This is the current output of ink-select-input
: