I'm working on a React Native page that's rendered in a Webview. My problem is that this page (/about
) has links that'll open things like /:id
but doesn't open them as a Webview. Here's my About
component:
export const About = () => {
return (
<SafeAreaView edges={['right', 'top', 'left']} style={{ flex: 1 }}>
<Webview url={`${BASE_URL}/about`} />
</SafeAreaView>
)
}
As things currently stand, I want /:id
to be opened in a Webview as well, which has all the various overrides that I want. After digging into react-router-native, I've set up something like:
export const About = () => {
return (
<NativeRouter>
<SafeAreaView edges={['right', 'top', 'left']} style={{ flex: 1 }}>
// no idea if this link is necessary?
<Link to="/:id" />
<Webview url={`${BASE_URL}/about`} />
<Switch>
<Route path="/:id" element={OtherWebview} />
</Switch>
</SafeAreaView>
</NativeRouter>
)
}
But that ended up causing errors elsewhere. I'd love some help on determining if I'm going down the right direction. I have limited experience with React Router, so your input is greatly appreciated. Again, all I want to figure out is a clean way to open the pages from /about
to also be in a Webview. I'd be happy to provide more details.