fix: browser history
This commit is contained in:
parent
a014b4e6cb
commit
f709c50809
5 changed files with 34 additions and 22 deletions
|
@ -1,5 +1,6 @@
|
|||
import React, {useState, useEffect} from 'react'
|
||||
import {SafeAreaProvider} from 'react-native-safe-area-context'
|
||||
import {getInitialURL} from 'platform/urls'
|
||||
import * as view from './view/index'
|
||||
import {RootStoreModel, setupState, RootStoreProvider} from './state'
|
||||
import {WebShell} from './view/shell/web'
|
||||
|
@ -13,7 +14,14 @@ function App() {
|
|||
// init
|
||||
useEffect(() => {
|
||||
view.setup()
|
||||
setupState().then(setRootStore)
|
||||
setupState().then(store => {
|
||||
setRootStore(store)
|
||||
getInitialURL().then(url => {
|
||||
if (url) {
|
||||
store.nav.handleLink(url)
|
||||
}
|
||||
})
|
||||
})
|
||||
}, [])
|
||||
|
||||
// show nothing prior to init
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue