react-native-router-flux

Router state not being persisted in react-native with redux

坚强是说给别人听的谎言 提交于 2019-12-05 10:47:46
问题 I have the following redux configuration in react-native using react-native-router-flux and redux-persist . I want to retrieve the last current route on refresh, however the route stack is being overwritten on reload. This is the reducers/index.js file import { combineReducers, createStore, applyMiddleware, compose } from 'redux' import { persistStore, autoRehydrate } from 'redux-persist' import { AsyncStorage } from 'react-native' import logger from 'redux-logger' import { startServices }

React native router flux: TypeError: undefined is not a function (evaluating 'addListener')

情到浓时终转凉″ 提交于 2019-12-05 03:04:06
问题 Im working on a react native app using this principal dependencies: react native react native router flux react thunk expo I was working using this package.json: "dependencies": { "expo": "23.0.4", "humps": "^2.0.0", "install": "^0.10.1", "lodash": "^4.17.4", "native-base": "^2.3.5", "react": "16.0.0", "react-native": "0.50.4", "react-native-extend-indicator": "^0.1.2", "react-native-keyboard-aware-scroll-view": "^0.4.2", "react-native-maps": "^0.19.0", "react-native-maps-directions": "^1.3.0

Override back press react native router flux

别说谁变了你拦得住时间么 提交于 2019-12-05 02:56:00
问题 I am using react native router flux in my react native app. I want to override the back button press event as I want to add confirmation popup before going back. I have searched a lot but all the links I found was for overriding hardware back button press of Android. I not only want to override the hardware back press but also want to override the back button press event in the navigation bar (for both Android and iOS). Please help me out here. Edit: I found one way to override the back press

react-native-router-flux: How to prevent Tab Scene history stack from being reset when changing between tabs?

。_饼干妹妹 提交于 2019-12-04 07:29:15
I have a Router setup with 2 tab scenes: Tab 1: have 2 navigable scenes (static screens); Screen A: have a button to navigate to Screen B ; Screen B: just have a text; Tab 2: just have 1 static screen. Screen C: just have a text; The code is as follows. app.js: import React from 'react'; import { Router, Scene } from 'react-native-router-flux'; import Tab from '../tab'; import ScreenA from './a'; import ScreenB from './b'; import ScreenC from './c'; export default class App extends React.Component { render(){ return ( <Router> <Scene key="root"> <Scene key="tabbar" tabs={true}> <Scene key=

Router state not being persisted in react-native with redux

独自空忆成欢 提交于 2019-12-04 00:29:49
I have the following redux configuration in react-native using react-native-router-flux and redux-persist . I want to retrieve the last current route on refresh, however the route stack is being overwritten on reload. This is the reducers/index.js file import { combineReducers, createStore, applyMiddleware, compose } from 'redux' import { persistStore, autoRehydrate } from 'redux-persist' import { AsyncStorage } from 'react-native' import logger from 'redux-logger' import { startServices } from '../services' import navigation from './navigation' import devices from './devices' import rooms

React native router flux: TypeError: undefined is not a function (evaluating 'addListener')

帅比萌擦擦* 提交于 2019-12-03 20:13:31
Im working on a react native app using this principal dependencies: react native react native router flux react thunk expo I was working using this package.json: "dependencies": { "expo": "23.0.4", "humps": "^2.0.0", "install": "^0.10.1", "lodash": "^4.17.4", "native-base": "^2.3.5", "react": "16.0.0", "react-native": "0.50.4", "react-native-extend-indicator": "^0.1.2", "react-native-keyboard-aware-scroll-view": "^0.4.2", "react-native-maps": "^0.19.0", "react-native-maps-directions": "^1.3.0", "react-native-modal-datetime-picker": "^4.13.0", "react-native-qrcode": "^0.2.6", "react-native

React Native + react-native-router-flux: How to apply hideNavBar to only one <Scene/>?

╄→гoц情女王★ 提交于 2019-12-02 09:14:27
问题 In React Native using react-native-router-flux, I have two <Scene/> and when I apply hideNavBar to the first one, Login , it also applies to the second, Home even though they are on the same level. How can I apply hideNavBar to only one <Scene/> , Login ? const RouterWithRedux = connect()(Router) const store = configureStore() export default class App extends Component { render() { return ( <Provider store={store}> <RouterWithRedux> <Scene key='root'> <Scene component={Login} hideNavBar

ComponentWillMount warning

北慕城南 提交于 2019-12-01 04:47:58
问题 I am creating a layout with inside. I am getting to this scene from another. So at the beginning another layout is rendered. After i go to the second scene (with TextInput tag) i obtain warnings such as: componentWillMount is deprecated and will be removed in the next major version. Use componentDidMount instead. As a temporary workaround, you can rename to UNSAFE_componentWillMount. Please update the following components: App, Container, Image, Text< TouchableOpacity, Transitioner, View.

How to pass values to other component in React-Native-Router-Flux?

孤街醉人 提交于 2019-11-28 06:19:10
My code is: ... <Router> <Scene key="com1" component={Com1} initial/> <Scene key="com2" component={Com2}/> </Router> ... com1.js ... onPress={Actions.com2} I changed com1 to com2 . But I need to pass values for the inputbox of Com1 to Com2 . How can I do that? Alexandre Teixeira You can pass data like this: Actions.com2 ({text: 'Hello World'}) You can recover your data in com2 like this: this.props.text You can go to the next tutorial for more information: https://github.com/aksonov/react-native-router-flux/blob/master/docs/v3/MINI_TUTORIAL.md In addition to that, (and for those in the

How to pass values to other component in React-Native-Router-Flux?

ぐ巨炮叔叔 提交于 2019-11-27 00:54:09
问题 My code is: ... <Router> <Scene key="com1" component={Com1} initial/> <Scene key="com2" component={Com2}/> </Router> ... com1.js ... onPress={Actions.com2} I changed com1 to com2 . But I need to pass values for the inputbox of Com1 to Com2 . How can I do that? 回答1: You can pass data like this: Actions.com2 ({text: 'Hello World'}) You can recover your data in com2 like this: this.props.text You can go to the next tutorial for more information: https://github.com/aksonov/react-native-router