You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
exactOptionalPropertyTypes makes TypeScript truly enforce the definition provided matches the actual javascript value.
It's a recently added feature (v4.4) that is increasing in use.
However, many of Ionic's types are incompatible with exactOptionalPropertyTypes. This is because they define types as this:
"shape"?: 'round';
and not this:
"shape"?: 'round'|undefined;
It is worth noting that core React types follow the latter convention. Example:
Describe the Use Case
See above.
Describe Preferred Solution
Unless there is a specific reason, all Ionic attributes with ? also list undefined as an explicit accepted value.
Describe Alternatives
Not using exactOptionalPropertyTypes will opt the user out of many benefits, but it is a workaround for now.
Related Code
No response
Additional Information
This could also be considered a bug for certain attributes, since certain types, like className defined here don't actually conform with the React className attribute:
The text was updated successfully, but these errors were encountered:
Prerequisites
Describe the Feature Request
exactOptionalPropertyTypes
makes TypeScript truly enforce the definition provided matches the actual javascript value.It's a recently added feature (v4.4) that is increasing in use.
However, many of Ionic's types are incompatible with
exactOptionalPropertyTypes
. This is because they define types as this:and not this:
It is worth noting that core React types follow the latter convention. Example:
Describe the Use Case
See above.
Describe Preferred Solution
Unless there is a specific reason, all Ionic attributes with
?
also listundefined
as an explicit accepted value.Describe Alternatives
Not using
exactOptionalPropertyTypes
will opt the user out of many benefits, but it is a workaround for now.Related Code
No response
Additional Information
This could also be considered a bug for certain attributes, since certain types, like
className
defined here don't actually conform with the ReactclassName
attribute:The text was updated successfully, but these errors were encountered: