This repository was archived by the owner on Feb 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-21
lines changed
Expand file tree Collapse file tree 3 files changed +22
-21
lines changed Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+ import { UIManager } from 'react-native' ;
3+ import RNCMaskedView from '@react-native-community/masked-view' ;
4+
5+ type Props = React . ComponentProps < typeof RNCMaskedView > & {
6+ children : React . ReactElement ;
7+ } ;
8+
9+ const isMaskedViewAvailable =
10+ // @ts -ignore
11+ UIManager . getViewManagerConfig ( 'RNCMaskedView' ) != null ;
12+
13+ export default function MaskedView ( { children, ...rest } : Props ) {
14+ if ( isMaskedViewAvailable ) {
15+ return < RNCMaskedView { ...rest } > { children } </ RNCMaskedView > ;
16+ }
17+
18+ return children ;
19+ }
Original file line number Diff line number Diff line change 11import * as React from 'react' ;
2- import { UIManager } from 'react-native' ;
3- import RNCMaskedView from '@react-native-community/masked-view' ;
42
5- type Props = React . ComponentProps < typeof RNCMaskedView > & {
3+ type Props = {
4+ maskElement : React . ReactElement ;
65 children : React . ReactElement ;
76} ;
87
9- const isMaskedViewAvailable =
10- // @ts -ignore
11- UIManager . getViewManagerConfig ( 'RNCMaskedView' ) != null ;
12-
13- export default function MaskedView ( { children, ...rest } : Props ) {
14- if ( isMaskedViewAvailable ) {
15- return < RNCMaskedView { ...rest } > { children } </ RNCMaskedView > ;
16- }
17-
8+ export default function MaskedView ( { children } : Props ) {
189 return children ;
1910}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments