Skip to content

Commit 413c6c8

Browse files
committed
Importing SafeAreaView from react-native-safe-area-context to get rid of deprecation warnings for importing it from 'react-native'
1 parent 2b49028 commit 413c6c8

File tree

10 files changed

+17
-11
lines changed

10 files changed

+17
-11
lines changed

example/src/App.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import React from 'react';
22
import Mapbox from '@rnmapbox/maps';
3-
import { StyleSheet, Text, View, LogBox, SafeAreaView } from 'react-native';
3+
import { StyleSheet, Text, View, LogBox } from 'react-native';
44
import { createNativeStackNavigator } from '@react-navigation/native-stack';
55
import { NavigationContainer } from '@react-navigation/native';
6-
import { SafeAreaProvider } from 'react-native-safe-area-context';
6+
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
77

88
import sheet from './styles/sheet';
99
import colors from './styles/colors';

example/src/examples/Map/MapAndRNNavigation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useState } from 'react';
2-
import { Button, Modal, Text, SafeAreaView } from 'react-native';
2+
import { Button, Modal, Text } from 'react-native';
33
import { MapView, UserLocation, Camera } from '@rnmapbox/maps';
4+
import { SafeAreaView } from 'react-native-safe-area-context';
45

56
/**
67
* @param {ItempProps['navigation']} navigation

example/src/examples/SymbolCircleLayer/Earthquakes.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import MapboxGL, {
1111
import { FeatureCollection } from 'geojson';
1212
import moment from 'moment';
1313
import React, { useRef, useState } from 'react';
14-
import { FlatList, SafeAreaView } from 'react-native';
14+
import { FlatList } from 'react-native';
15+
import { SafeAreaView } from 'react-native-safe-area-context';
1516

1617
import earthQuakesJSON from '../../assets/earthquakes.json';
1718
import { SF_OFFICE_COORDINATE } from '../../utils';

example/src/examples/UserLocation/CustomNativeUserLocation.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
2-
import { SafeAreaView, View } from 'react-native';
2+
import { View } from 'react-native';
3+
import { SafeAreaView } from 'react-native-safe-area-context';
34
import {
45
MapView,
56
Camera,

example/src/examples/UserLocation/SetDisplacement.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import Mapbox, { MapView, UserLocation, Camera } from '@rnmapbox/maps';
3-
import { SafeAreaView } from 'react-native';
3+
import { SafeAreaView } from 'react-native-safe-area-context';
44
import { ButtonGroup } from '@rneui/base';
55

66
const DISPLACEMENT = [0, 5, 10];

example/src/examples/UserLocation/SetTintColor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { MapView, Camera, UserLocation } from '@rnmapbox/maps';
33
import { ButtonGroup } from '@rneui/base';
4-
import { SafeAreaView } from 'react-native';
4+
import { SafeAreaView } from 'react-native-safe-area-context';
55

66
const COLOR = ['red', 'yellow', 'green'];
77
const OPTIONS = [{ label: 'red' }, { label: 'yellow' }, { label: 'green' }];

example/src/examples/UserLocation/UserLocationPadding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
type CameraPadding,
77
} from '@rnmapbox/maps';
88
import { ButtonGroup } from '@rneui/base';
9-
import { SafeAreaView } from 'react-native';
9+
import { SafeAreaView } from 'react-native-safe-area-context';
1010

1111
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-example-doc
1212

example/src/examples/UserLocation/UserLocationRenderMode.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
UserLocationRenderMode as UserLocationRenderModeType,
88
UserTrackingMode,
99
} from '@rnmapbox/maps';
10-
import { Button, Platform, SafeAreaView, View } from 'react-native';
10+
import { Button, Platform, View } from 'react-native';
11+
import { SafeAreaView } from 'react-native-safe-area-context';
1112
import { ButtonGroup, Text } from '@rneui/base';
1213

1314
import { DEFAULT_CENTER_COORDINATE } from '../../utils';

example/src/examples/V10/MapHandlers.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import {
1616
Position,
1717
} from 'geojson';
1818
import React, { useState } from 'react';
19-
import { SafeAreaView, View } from 'react-native';
19+
import { View } from 'react-native';
20+
import { SafeAreaView } from 'react-native-safe-area-context';
2021

2122
import colors from '../../styles/colors';
2223
import { ExampleWithMetadata } from '../common/ExampleMetadata'; // exclude-from-doc

example/src/scenes/ScreenWithoutMap.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { NativeStackScreenProps } from '@react-navigation/native-stack';
22
import React, { JSX } from 'react';
3-
import { Button, Text, View, SafeAreaView } from 'react-native';
3+
import { Button, Text, View } from 'react-native';
4+
import { SafeAreaView } from 'react-native-safe-area-context';
45

56
type StackParamsList = {
67
ScreenWithoutMap: Record<string, never>;

0 commit comments

Comments
 (0)