mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Update modal wrapper to be translatable to TypeScript (#49923)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49923 Changelog: [Internal] Reviewed By: huntie Differential Revision: D70887822 fbshipit-source-id: 729e91245cfb750cf1de4f4532925ff7263b3d82
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e7c44b2a26
commit
c04b4a92d1
+5
-1
@@ -362,6 +362,10 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
});
|
||||
|
||||
type ModalRefProps = $ReadOnly<{
|
||||
ref?: React.RefSetter<PublicModalInstance>,
|
||||
}>;
|
||||
|
||||
// NOTE: This wrapper component is necessary because `Modal` is a class
|
||||
// component and we need to map `ref` to a differently named prop. This can be
|
||||
// removed when `Modal` is a functional component.
|
||||
@@ -369,7 +373,7 @@ function Wrapper({
|
||||
ref,
|
||||
...props
|
||||
}: {
|
||||
ref?: React.RefSetter<PublicModalInstance>,
|
||||
...ModalRefProps,
|
||||
...ModalProps,
|
||||
}): React.Node {
|
||||
return <Modal {...props} modalRef={ref} />;
|
||||
|
||||
@@ -5985,10 +5985,10 @@ export type ModalProps = {
|
||||
...ModalPropsAndroid,
|
||||
...ViewProps,
|
||||
};
|
||||
declare function Wrapper({
|
||||
type ModalRefProps = $ReadOnly<{
|
||||
ref?: React.RefSetter<PublicModalInstance>,
|
||||
...ModalProps,
|
||||
}): React.Node;
|
||||
}>;
|
||||
declare function Wrapper({ ...ModalRefProps, ...ModalProps }): React.Node;
|
||||
declare export default typeof Wrapper;
|
||||
"
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user