tippyjs-react icon indicating copy to clipboard operation
tippyjs-react copied to clipboard

Inertia React

Open DeviJv opened this issue 2 years ago • 1 comments

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.

DeviJv avatar Feb 16 '23 08:02 DeviJv

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.

vitkarpov avatar Jun 13 '23 11:06 vitkarpov