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

Modal.createDialog(...) throws strict TypeScript errors #24899

Closed
MadLittleMods opened this issue Mar 22, 2023 · 1 comment
Closed

Modal.createDialog(...) throws strict TypeScript errors #24899

MadLittleMods opened this issue Mar 22, 2023 · 1 comment
Labels
A-Developer-Experience A-Testing Testing, code coverage, etc. T-Task Tasks for the team like planning

Comments

@MadLittleMods
Copy link
Contributor

MadLittleMods commented Mar 22, 2023

Spawning from matrix-org/matrix-react-sdk#10405 (comment),

Our Modal.createDialog(...) usage throws strict TypeScript errors when you start touching parts of that code.

ex.

Modal.createDialog(ErrorDialog, {
    title: _t("Upload Failed"),
    description: desc,
});
Argument of type 'typeof ErrorDialog' is not assignable to parameter of type 'ComponentType'.

Another example:

Argument of type 'typeof BugReportDialog' is not assignable to parameter of type 'ComponentType'.

Potential solutions

We probably need to fix the Type definitions in Modal.createDialog(...) to more accurately portray what we're doing. I'm not sure what those changes would look like.

@t3chguy
Copy link
Member

t3chguy commented Mar 22, 2023

Targeted by matrix-org/matrix-react-sdk#10387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Developer-Experience A-Testing Testing, code coverage, etc. T-Task Tasks for the team like planning
Projects
None yet
Development

No branches or pull requests

2 participants