mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-26 13:35:32 +08:00
feat: make example run as bare react-native project as well (#85)
This commit is contained in:
committed by
Satyajit Sahoo
parent
9563a27284
commit
d16c20cd39
2
packages/example/src/LinkingPrefixes.expo.ts
Normal file
2
packages/example/src/LinkingPrefixes.expo.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
import { Linking } from 'expo';
|
||||
export default [Linking.makeUrl('/')];
|
||||
1
packages/example/src/LinkingPrefixes.ts
Normal file
1
packages/example/src/LinkingPrefixes.ts
Normal file
@@ -0,0 +1 @@
|
||||
export default [];
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { ScrollView, AsyncStorage, YellowBox } from 'react-native';
|
||||
import { Linking } from 'expo';
|
||||
import LinkingPrefixes from './LinkingPrefixes';
|
||||
import { Appbar, List } from 'react-native-paper';
|
||||
import { Asset } from 'expo-asset';
|
||||
import {
|
||||
@@ -72,7 +72,7 @@ export default function App() {
|
||||
// iOS: xcrun simctl openurl booted exp://127.0.0.1:19000/--/simple-stack
|
||||
// The first segment of the link is the the scheme + host (returned by `Linking.makeUrl`)
|
||||
const { getInitialState } = useLinking(containerRef, {
|
||||
prefixes: [Linking.makeUrl('/')],
|
||||
prefixes: LinkingPrefixes,
|
||||
getStateFromPath: path => {
|
||||
const state = getStateFromPath(path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user