Questions tagged [react-router-native]

40 questions
27
votes
2 answers

how to use react-native-web and react-navigation together and access from web url

UPDATE: react-navigation web support is done. follow this: https://reactnavigation.org/docs/en/web-support.html ORIGIN: I try to share my code between react-native and web. when I try react-native-web, it works well. but there is only one question,…
7
votes
0 answers

Technical difference between react-router-native and react-navigation

newbie here at React Native. react-router is a popular library for navigation in web apps. This same library has a package that provides an API for navigation in RN, react-router-native. Docs After reading react-navigation's pitch and anti-pitch, I…
6
votes
1 answer

How can I solve the Module parse failed: Unexpected token (11:9) react-router-native

I installed react-native-router using yarn and just on importing NativeRouter This is how I import from react-router-native import { NativeRouter, Route, Link } from "react-router-native"; This is the error I…
iamafasha
  • 848
  • 10
  • 29
3
votes
3 answers

Is it possible to apply animation for react-router-native?

I know that this question sounds like asking for suggestion which should not be here, But I am posting after searching a lot for my requirement. I am using react-router-native for navigation which is great functionality wise. But comes to the…
ThinkAndCode
  • 1,319
  • 3
  • 29
  • 60
3
votes
1 answer

react-router-native AndroidBackButton is not firing

i'm using react-router-native with an ejected CRNA app. i've added the component to my as it shows in the docs, but it doesn't seem to be firing. is there some way i can debug this to see if it's just not getting a…
rkstar
  • 1,178
  • 14
  • 27
2
votes
1 answer

Redirect to View Component from an Axios interceptor (outside of a component) in React Native with React-Router-Native

I am working on a service class to create an instance of Axios (in React Native) where I'm using some interceptors to inject the JWT Token to authenticate against an API. When the app detects that the access token is expired, automatically use the…
Yulio Aleman Jimenez
  • 1,642
  • 3
  • 17
  • 33
2
votes
0 answers

Support for the experimental syntax 'classProperties' isn't currently enabled for react-router-native?

I'm currently learning about setting up a react-native-web that uses TypeScript and am getting an error where react-router-native is throwing an error saying: Support for the experimental syntax 'classProperties' isn't currently enabled. Checked…
1
vote
1 answer

Invalid hook call React Native FlatList Navigation

I'm making a notes app in React Native and trying to make it so I can click on a note in a FlatList to edit it. I'm using react-router-native for this. I get an Error when clicking on any FlatList item. I know that this error has been asked on stack…
1
vote
0 answers

REACT NATIVE can't pass location.state in a CLASS COMPONENT using react-router-native anymore (TypeError: Cannot read property 'state' of undefined)

I need to pass data forward to another component via from the react-router-native library. This worked a couple of months ago, then I upgraded RN and all of the packages that I use and it's no longer working. I found an answer which I thought…
jem4789
  • 89
  • 9
1
vote
1 answer

React Native Webview routing from a Webview to another Webview

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 ( …
Atticus
  • 418
  • 2
  • 6
  • 20
1
vote
1 answer

Component changing but not URL in react-router-native

When I click on a tag in my react-native file, the component will change as expected, however URL however does not get updated at all and remains at the base localhost URL. If I manually go and change the URL to search for the desired route…
1
vote
1 answer

How to programmatically navigate in React Router Native?

What is the react-router-native equivalent of the react-router: history = useHistory() history.push('/new/path') ?
1
vote
0 answers

react-router-native giving error in Expo CLI - React Native

I have installed react-router-native in my project using npm and I am getting an error saying: E:/myapp/node_modules/react-router-native/NativeRouter.js, 11:9 Module parse failed: Unexpected token (11:9).... You may need an appropriate loader to…
1
vote
0 answers

Is there a better way to test React Native class component functions when using Redux and React Router Native?

I'm trying to write tests in Jest for a React Native project I'm working on. I'm using redux and react-router-native and I can't render the components for the tests without wrapping them in a Provider and MemoryRouter. The component I'm trying to…
1
2 3