Traviskn / react-router-native-stack

A stack navigation component for react-router-native
MIT License
170 stars 36 forks source link

crashes for no match route #38

Open ethanneff opened 6 years ago

ethanneff commented 6 years ago

react-router-native example https://reacttraining.com/react-router/native/example/no-match

navigation

<Button title="404" onPress={() => history.push("/nowhere")} />

routing

      <NativeRouter>
        <Stack>
          <Route exact path="/" component={Landing} />
          <Route path="/login" component={Login} />
          <Route auth path="/app" component={Main} />
          <Route component={NotFound} />
        </Stack>
      </NativeRouter>

error

TypeError: null is not an object (evaluating 'children.props')

This error is located at:
    in StackTransitioner (at Stack.js:62)
    in RCTView (at View.js:43)
    in Stack (created by Route)
    in Route (created by withRouter(Stack))
    in withRouter(Stack) (created by AppComponent)
    in BackButton (created by Router)
    in Router (created by MemoryRouter)
    in MemoryRouter (at NativeRouter.js:10)
    in NativeRouter (created by Router)
    in Router (created by AppComponent)
    in AppComponent (created by Connect(AppComponent))
    in Connect(AppComponent)
    in RCTView (at View.js:43)
    in KeyboardAvoidingView (created by ScreenComponent)
    in RCTSafeAreaView (at SafeAreaView.ios.js:35)
    in SafeAreaView (created by ScreenComponent)
    in ScreenComponent (created by Connect(ScreenComponent))
    in Connect(ScreenComponent)
    in Provider
    in Unknown (at renderApplication.js:32)
    in RCTView (at View.js:43)
    in RCTView (at View.js:43)
    in AppContainer (at renderApplication.js:31)

render
    StackTransitioner.js:271:28
finishClassComponent
    ReactNativeRenderer-dev.js:9943:21
performUnitOfWork
    ReactNativeRenderer-dev.js:13126:21
workLoop
    ReactNativeRenderer-dev.js:13165:41
renderRoot
    ReactNativeRenderer-dev.js:13218:15
performWorkOnRoot
    ReactNativeRenderer-dev.js:13941:17
performWork
    ReactNativeRenderer-dev.js:13854:24
performSyncWork
    ReactNativeRenderer-dev.js:13814:14
batchedUpdates$1
    ReactNativeRenderer-dev.js:14045:6
batchedUpdates
    ReactNativeRenderer-dev.js:2525:27
_receiveRootNodeIDEvent
    ReactNativeRenderer-dev.js:2619:17
receiveTouches
    ReactNativeRenderer-dev.js:2695:28
__callFunction
    MessageQueue.js:344:47
<unknown>
    MessageQueue.js:107:26
__guard
    MessageQueue.js:291:8
callFunctionReturnFlushedQueue
    MessageQueue.js:106:17

current solution: remove Stack for Switch (which removes this library)