djorg83 / react-bootstrap-sweetalert

A React implementation of SweetAlert
https://djorg83.github.io/react-bootstrap-sweetalert/
MIT License
253 stars 55 forks source link

Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes #79

Open yoyos opened 1 year ago

yoyos commented 1 year ago

Simple example:

<SweetAlert warning title={'my title'} onConfirm={() => <></>}>
        MyContent
      </SweetAlert>

Typescript exception:

S2322: Type '{ children: string; warning: true; title: string; onConfirm: () => Element; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<SweetAlert> & Pick<Pick<Readonly<SweetAlertProps>, keyof SweetAlertProps> & Pick<...> & Pick<...>, "title" | ... 24 more ... | "customButtons"> & InexactPartial<...> & InexactPartial<...>'.
  Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<SweetAlert> & Pick<Pick<Readonly<SweetAlertProps>, keyof SweetAlertProps> & Pick<...> & Pick<...>, "title" | ... 24 more ... | "customButtons"> & InexactPartial<...> & InexactPartial<...>'.

using:

"typescript": "^4.8.4"
"bootstrap": "^5.2.2",
"react-bootstrap": "^2.5.0",
"react": "^18.2.0",
Kaique292 commented 6 months ago

code

Just do that