0

I'm trying to set a route based on a BASE_URL (URL of live web app) and also takes an :id parameter of some kind but I'm seeing an error of No routes matched location "/". I'm working with React Native and react-router-native v6.

Here is a code snippet:

return (
    <NativeRouter>
      <SafeAreaView edges={['right', 'top', 'left']} style={{ flex: 1 }}>
        <Webview url={`${BASE_URL}/about`} />

        <Routes>
          <Route path={`${BASE_URL}/:id`} element={SomeWebview} />
        </Routes>
      </SafeAreaView>
    </NativeRouter>
  )
}

When a link from this current page/component with some unique ID is clicked, I want the component SomeWebview to be rendered, which it isn't right now. I'd be happy to provide more details as necessary. Thank you.

Atticus
  • 418
  • 2
  • 6
  • 20
  • It's like the error says, there needs to be a route rendering on `path="/"`. `"/"` is considered the root path the app/router is rendered on. – Drew Reese Oct 14 '22 at 01:35

0 Answers0