unpkg usage throwing react type is invalid error
See original GitHub issueDescribe the bug When I try to use react-day-picker I get the follow errors in my console
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
To Reproduce I can reproduce the error in the sandbox here -https://codesandbox.io/s/react-day-picker-base-vt99v
Expected behavior Should be able to use the react-day-picker normally
Issue Analytics
- State:
- Created 4 years ago
- Comments:21 (2 by maintainers)
Top Results From Across the Web
unpkg usage throwing react type is invalid error - - Bountysource
Describe the bug. When I try to use react-day-picker I get the follow errors in my console. Element type is invalid: expected a...
Read more >React Element Type is Invalid, why am I getting this error and ...
"Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.
Read more >types/react/index.d.ts - UNPKG
* This lifecycle is invoked after an error has been thrown by a descendant component. 661, * It receives the error that was...
Read more >single-spa-react
Use single-spa-react to create and export single-spa lifecycle functions from ... an Error boundary without having to write your own class component for...
Read more >React v17.0 – React Blog
This demo uses Create React App, but it should be possible to follow a similar approach with any other tool. We welcome demos...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is the error I get
In the render function I have a used DayPickerInput using the wrapper component from my component library. which imports
import DayPickerInput from 'react-day-picker/DayPickerInput';
Here is the render function of the library wrapper component
In my component library rollup config, I have these plugins and commonjs with namedExports
Do I have to do any namedExports for
react-day-picker/DayPickerInput
because I cannot find any export statement in DayPicker.js or types/index.ts under node_moduels/react-day-picker.If possible can you share a snippet of your plugins in rollup.config.js
This is a nice workaround https://github.com/gpbl/react-day-picker/issues/1194#issuecomment-814065458