tippyjs-react
tippyjs-react copied to clipboard
Inertia React
Uncaught Error: 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.
UPD sorry, it's "Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object." not undefined
Happened to me whilst migrating from [email protected]
to [email protected]
too, most likely because of esbuild.
I found a hack to work around this:
import Tippy from '@tippyjs/react';
const TippyComponent =
(Tippy as unknown as { default: typeof Tippy }).default ??
Tippy;
then use <TippyComponent>
instead of <Tippy>
in the app.