Merge pull request #19522 from huhuanming/react-natvie-maskview

Add MaskedView
This commit is contained in:
Eloy Durán
2017-09-02 18:55:09 +02:00
committed by GitHub
2 changed files with 30 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
// Type definitions for react-native 0.47
// Type definitions for react-native 0.48
// Project: https://github.com/facebook/react-native
// Definitions by: Eloy Durán <https://github.com/alloy>
// Fedor Nezhivoi <https://github.com/gyzerok>
@@ -4328,6 +4328,16 @@ export interface MapViewStatic extends NativeMethodsMixin, React.ComponentClass<
}
}
interface MaskedViewProperties extends ViewProperties {
maskElement: React.ReactElement<any>,
}
/**
* @see https://facebook.github.io/react-native/docs/maskedviewios.html
*/
export interface MaskedViewStatic extends NativeMethodsMixin, React.ComponentClass<MaskedViewProperties> {
}
export interface ModalProperties {
// Only `animated` is documented. The JS code says `animated` is
@@ -8893,6 +8903,9 @@ export type ListView = ListViewStatic
export var MapView: MapViewStatic
export type MapView = MapViewStatic
export var MaskedView: MaskedViewStatic
export type MaskedView = MaskedViewStatic
export var Modal: ModalStatic
export type Modal = ModalStatic

View File

@@ -39,7 +39,8 @@ import {
ScrollViewProps,
RefreshControl,
TabBarIOS,
NativeModules
NativeModules,
MaskedView,
} from 'react-native';
declare module 'react-native' {
@@ -354,3 +355,17 @@ class AlertTest extends React.Component {
);
}
}
class MaskedViewTest extends React.Component {
render() {
return (
<MaskedView
maskElement={
<View />
}
>
<View />
</MaskedView>
)
}
}