Questions tagged [react-router-native]
40 questions
1
vote
1 answer
Test using react-router-native's Link blows up with "TypeError: Cannot read property 'default' of undefined"
For a react-native app using react-router, jest and react-test-renderer, the component doesn't seem to be testable. The react-router documentation makes no mention of having to do anything special (mocking?) for react-native and my tests only…

outofculture
- 6,023
- 1
- 18
- 20
1
vote
1 answer
react-router-native renders blank page
The logic seems simple, though I've tried a half-dozen permutations to see if anything changes. I have no idea why react-router is behaving this way:
import React from 'react'
import { View, Text } from 'react-native'
import { observer, inject }…

hunterloftis
- 13,386
- 5
- 48
- 50
1
vote
1 answer
react-router-native doesnt work
Error:
undefined is not an object (evaluating '_this.context.router.history')
index.js:

kutirie
- 583
- 1
- 4
- 9
1
vote
3 answers
React router native animation blinks before animation starts
I'm developing a react native app and using React router native v4, and I'm trying to develop the animation part, as suggested by documentation, first I made sure that everything works without animations or transitions.
I've iterated the…

Javier P
- 1,332
- 14
- 21
1
vote
1 answer
React Native Router - Element type is invalid
I'm trying to make routes for the different pages in my React Native app. So I've created a router.js file with a new Router:
// @flow
import React, { Component } from 'react';
import View from 'react-native';
import { NativeRouter, Route,…

Nieck
- 1,626
- 3
- 21
- 41
1
vote
2 answers
Don't render a route on a specific path React Router Native?
I am using React Router Native I want to hide a component on a specific path
In my Home…

deadcoder0904
- 7,232
- 12
- 66
- 163
1
vote
0 answers
Update title and/or buttons in navbar from within component with react-router-native & react-router-navigation
I am using react-router-navigation in my app. Let's say we have a login page where user have to enter his username and this username should appear in navbar as user is typing.
Given that routing is defined elsewhere from the actual component and…

Max Komarychev
- 2,836
- 1
- 21
- 32
0
votes
0 answers
React Router Native v6 - No routes matched location "/"
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…

Atticus
- 418
- 2
- 6
- 20
0
votes
1 answer
React-Router-Native passing image as parameter
Im trying to pass image as my parameter on react-router-native and trying to get the data from the location.state but im having issue.
I usually do this to display image
Import Icon from '../image/icon.png';

Mer Merced
- 33
- 7
0
votes
0 answers
0
votes
1 answer
Detect route change in react-router-native
I'm using react-router-native to navigate between the "pages" of my app. The problem here is that I want to change the app-bar visibility depending on the user location.
So, I need a way to watch and detect the route, so I can manipulate-it

Lucas Gardini Dias
- 504
- 4
- 13
0
votes
1 answer
Access history with pages created through render()
I am attempting to implement a multi-language option in my React Native application. I'm using react-router to navigate the page. The approach I am attempting involves passing the current locale to the components as a prop.
App.js
import React from…

Elias Mäkelä
- 43
- 1
- 6
0
votes
1 answer
React router native error, Unexpected Token
import { StatusBar } from "expo-status-bar";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import Login from "./components/Login";
import Home from "./components/Home";
import { NativeRouter, Switch, Route, Link }…

MANOJ H M
- 107
- 1
- 2
- 9
0
votes
1 answer
Receiving error when using component={TouchableOpacity} in link tag
I am trying to create a navigation bar that has tabs that link to different pages. I have currently gotten it to work when I use
Home
…

Say u
- 129
- 11
0
votes
1 answer
Is nested routing possible in react-native?
I am using react-router-native for routing. Usually when ever new route is pushed to history the current screen will be unmounted and new screen is mounted. But As per documentation nested routing is possible in web. They haven't mentioned anything…

ThinkAndCode
- 1,319
- 3
- 29
- 60