collapse icon indicating copy to clipboard operation
collapse copied to clipboard

rc-collapse fires an "unexpected import" error with react 16.6.3

Open pretentiousgit opened this issue 5 years ago • 2 comments

Following along with the examples, using Collapse triggers this error in my build:

Invariant Violation: 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. Check the render method of `ComponentName`.

Replacing Collapse with nothing or a string clears up the error. Panel export is fine.

React 16.6.3 Create-React-App stack Chrome browser

pretentiousgit avatar Jun 20 '19 15:06 pretentiousgit

Any reproduce?

afc163 avatar Jun 20 '19 15:06 afc163

The same thing here, I found the workaround for the import:

import Collapse from 'rc-collapse/es/index';

serjant avatar Jul 09 '20 11:07 serjant