Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have TypeScript Issue when using the Use custom component #5

Open
Ofer-Gal opened this issue Apr 30, 2022 · 1 comment
Open

I have TypeScript Issue when using the Use custom component #5

Ofer-Gal opened this issue Apr 30, 2022 · 1 comment

Comments

@Ofer-Gal
Copy link

const options = { render: (message, onConfirm, onCancel) => { return ( <> <h2> "Are you sure? </h2> <p>{message}</p> <PrimaryButton onClick={onConfirm} text="Yes" style={{ marginRight: '10px' }} /> <DefaultButton onClick={onCancel} text="No" style={{ marginLeft: '10px' }} /> </> ); } };

then the statement:
const result = await confirm(message, options);
Shows error:

TS2345: Argument of type '{ render: (message: any, onConfirm: any, onCancel: any) => Element; }' is not assignable to parameter of type 'Options'.
  The types returned by 'render(...)' are incompatible between these types.
    Type 'Element' is missing the following properties from type 'Element': attributes, classList, className, clientHeight, and 123 more.

How can I fix it?

@arimendelow
Copy link

I have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants