ionic-team/ionic-framework
Auf GitHub ansehenfeat: Improved types for react useIonModal
Open
#28.680 geöffnet am 11. Dez. 2023
help wantedpackage: reacttype: feature request
Repository-Metriken
- Stars
- (52.503 Stars)
- PR-Merge-Metriken
- (Durchschn. Merge 4T 10h) (56 gemergte PRs in 30 T)
Beschreibung
Prerequisites
- I have read the Contributing Guidelines.
- I agree to follow the Code of Conduct.
- I have searched for existing issues that already include this feature request, without success.
Describe the Feature Request
useIonModal should type props parameter.
Describe the Use Case
useIonModal currently allows any for component props. This is dangerous and has caused many crashes and unintended behaviors in my experience.
Currently:
export declare function useIonModal(component: ReactComponentOrElement, componentProps?: any): UseIonModalResult;
Describe Preferred Solution
export declare function useIonModal<P>(component: React.ComponentClass<P> | React.FC<P>, componentProps?: P): UseIonModalResult;
export declare function useIonModal(component: React.ReactElement, componentProps?: any): UseIonModalResult;
Describe Alternatives
Leaving as-is
Related Code
No response
Additional Information
If you would accept this change, I would happily make a PR