material-ui-confirm icon indicating copy to clipboard operation
material-ui-confirm copied to clipboard

Invalid ConfirmProvider types

Open asobirov opened this issue 1 year ago • 1 comments

When trying to use ConfirmProvider, I'm getting the following error:

(alias) const ConfirmProvider: React.ComponentType<ConfirmProviderProps>
import ConfirmProvider
'ConfirmProvider' cannot be used as a JSX component.
  Its element type 'ReactElement<any, any> | Component<ConfirmProviderProps, any, any> | null' is not a valid JSX element.
    Type 'Component<ConfirmProviderProps, any, any>' is not assignable to type 'Element | ElementClass | null'.
      Type 'Component<ConfirmProviderProps, any, any>' is not assignable to type 'ElementClass'.
        The types returned by 'render()' are incompatible between these types.
          Type 'React.ReactNode' is not assignable to type 'import("<path>/node_modules/@types/react-dom/node_modules/@types/react/index").ReactNode'.
            Type '{}' is not assignable to type 'ReactNode'.
              Type '{}' is missing the following properties from type 'ReactPortal': key, children, type, props

I suspect that the React.ComponentType that is used in type declarations may be outdated?

asobirov avatar Oct 14 '22 17:10 asobirov

It looks the same as https://github.com/zenoamaro/react-quill/issues/792#issuecomment-1126858196. If someone knows the proper way to address it in this package without breaking compatibility with React 17, I will happily accept a PR :)

jonatanklosko avatar Oct 17 '22 01:10 jonatanklosko