fresh icon indicating copy to clipboard operation
fresh copied to clipboard

Can not use react-select

Open hemedani opened this issue 7 months ago • 1 comments

Throw this error when use react-select library even with npm or esm.sh

Invalid type passed to createElement(): [object Object]

Error: Invalid type passed to createElement(): [object Object]
    at a.__b (https://esm.sh/stable/[email protected]/denonext/debug.js:23:9)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:2611)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:2543)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:5050)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:2543)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:5050)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:3802)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:5050)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string.mjs:2:3802)
    at m (https://esm.sh/v135/[email protected]/X-ZS8q/denonext/preact-render-to-string

And this is the LSP Diagnostic error message

'Select' cannot be used as a JSX component.
  Its type 'StateManagedSelect' is not a valid JSX element type.
    Type 'StateManagedSelect' is not assignable to type 'FunctionComponent<any>'.
      Call signature return types 'ReactElement<any, string | JSXElementConstructor<any>>' and 'VNode<any> | null' are incompatible.
        The types of 'type' are incompatible between these types.
          Type 'string | JSXElementConstructor<any>' is not assignable to type 'string | ComponentType<any>'.
            Type '(props: any, deprecatedLegacyContext?: any) => ReactNode' is not assignable to type 'string | ComponentType<any>'.
              Type '(props: any, deprecatedLegacyContext?: any) => ReactNode' is not assignable to type 'FunctionComponent<any>'.
                Type 'ReactNode' is not assignable to type 'VNode<any> | null'.
                  Type 'undefined' is not assignable to type 'VNode<any> | null'.

hemedani avatar Jul 11 '24 11:07 hemedani