ionic-framework
ionic-framework copied to clipboard
feat(react): type check component props for useIonModal, useIonPopover
Issue number: resolves #28680
What is the current behavior?
useIonModal and useIonPopover do not type check component parameters. This can cause bugs in applications that heavily use these hooks.
What is the new behavior?
- useIonModal and useIonPopover have new types
- If a component does not have props, second parameter can be omitted (
extends undefined) - Passing a JSX Element keeps old functionality (
anyfor props)
Does this introduce a breaking change?
- [ ] Yes
- [X] No
This may be considered a breaking change, because typescript will now complain if component props do not match up. The majority of my useIonModal usages required tweaks.