File tree Expand file tree Collapse file tree 1 file changed +15
-19
lines changed
packages/react-native-web/src/exports/SafeAreaView Expand file tree Collapse file tree 1 file changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -12,28 +12,24 @@ import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
12
12
import React from 'react' ;
13
13
import StyleSheet from '../StyleSheet' ;
14
14
import View from '../View' ;
15
- import ViewPropTypes , { type ViewProps } from '../ViewPropTypes' ;
15
+ import { type ViewProps } from '../ViewPropTypes' ;
16
16
17
- class SafeAreaView extends React . Component < ViewProps > {
18
- static displayName = 'SafeAreaView' ;
17
+ const SafeAreaView = React . forwardRef < View , ViewProps > ( ( props : ViewProps , ref ) = > {
18
+ const { style , ... rest } = props ;
19
19
20
- static propTypes = {
21
- ...ViewPropTypes
22
- } ;
20
+ return (
21
+ < View
22
+ { ...rest }
23
+ ref = { ref }
24
+ style = { StyleSheet . compose (
25
+ styles . root ,
26
+ style
27
+ ) }
28
+ />
29
+ ) ;
30
+ } ) ;
23
31
24
- render ( ) {
25
- const { style, ...rest } = this . props ;
26
- return (
27
- < View
28
- { ...rest }
29
- style = { StyleSheet . compose (
30
- styles . root ,
31
- style
32
- ) }
33
- />
34
- ) ;
35
- }
36
- }
32
+ SafeAreaView . displayName = 'SafeAreaView' ;
37
33
38
34
const cssFunction : 'constant' | 'env' = ( function ( ) {
39
35
if (
You can’t perform that action at this time.
0 commit comments