Skip to content

Commit 6648ed7

Browse files
fix: remove usage of react-native in the nitro module
1 parent 2f075cb commit 6648ed7

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

example/src/App.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export default function App() {
100100
<StatusBar barStyle="dark-content" />
101101
<View style={[styles.container]}>
102102
<MapboxTurnByTurnNavigationView
103+
style={styles.mapboxView}
103104
hybridRef={{ f: (hRef) => setHybridRef(hRef) }}
104105
origin={{
105106
longitude: 5.058566,
@@ -119,4 +120,7 @@ const styles = StyleSheet.create({
119120
container: {
120121
flex: 1,
121122
},
123+
mapboxView: {
124+
flex: 1,
125+
},
122126
});

src/index.tsx

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import type { ComponentProps } from 'react';
2-
31
const MapboxTurnByTurnNavigationConfig = require('../nitrogen/generated/shared/json/MapboxTurnByTurnNavigationConfig.json');
42
import type {
53
MapboxTurnByTurnNavigationMethods,
@@ -8,26 +6,9 @@ import type {
86

97
export * from './MapboxTurnByTurnNavigation.nitro';
108

11-
import { StyleSheet, View } from 'react-native';
129
import { getHostComponent } from 'react-native-nitro-modules';
1310

14-
export const NativeView = getHostComponent<
11+
export const MapboxTurnByTurnNavigationView = getHostComponent<
1512
MapboxTurnByTurnNavigationProps,
1613
MapboxTurnByTurnNavigationMethods
1714
>('MapboxTurnByTurnNavigation', () => MapboxTurnByTurnNavigationConfig);
18-
19-
export const MapboxTurnByTurnNavigationView = (
20-
props: ComponentProps<typeof NativeView>
21-
) => {
22-
return (
23-
<View style={[styles.container, props.style]}>
24-
<NativeView {...props} style={styles.container} />
25-
</View>
26-
);
27-
};
28-
29-
const styles = StyleSheet.create({
30-
container: {
31-
flex: 1,
32-
},
33-
});

0 commit comments

Comments
 (0)