mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 04:49:15 +08:00
Update React-Native Modal prop typings
Please fill in this template. - [x] Use a meaningful title for the pull request. Include the name of the package modified. - [x] Test the change in your own code. (Compile and run.) - [x] Follow the advice from the [readme](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#make-a-pull-request). - [x] Avoid [common mistakes](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#common-mistakes). - [x] Run `npm run lint package-name` (or `tsc` if no `tslint.json` is present). Select one of these and delete the others: If changing an existing definition: - [x] Provide a URL to documentation or source code which provides context for the suggested changes: https://github.com/facebook/react-native/blob/master/Libraries/Modal/Modal.js#L161 Additional info: Just like the onShow optional prop, the Modal's onOrientationChange prop can capture a NativeSyntheticEvent at the time of the hardware change. This allows the developer to determine if the orientation change was to the landscape or portrait style and react accordingly.
This commit is contained in:
2
types/react-native/index.d.ts
vendored
2
types/react-native/index.d.ts
vendored
@@ -4363,7 +4363,7 @@ export interface ModalProperties {
|
||||
* The orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation.
|
||||
* @platform ios
|
||||
*/
|
||||
onOrientationChange?: () => void;
|
||||
onOrientationChange?: (event?: NativeSyntheticEvent<any>) => void;
|
||||
/**
|
||||
* The `onDismiss` prop allows passing a function that will be called once the modal has been dismissed.
|
||||
* @platform ios
|
||||
|
||||
Reference in New Issue
Block a user