question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

_reactNativeRouterFlux.Actions.create is not a function

See original GitHub issue

Version

Tell us which versions you are using:

  • react-native-router-flux v4.0.0-beta.3
  • react-native v0.45.1

simple code:

const scenes = Actions.create(
  <Scene key="root">
    <Scene key="Start" component={Start} hideNavBar={true} duration={0}/>
    <Scene key="Login" component={Login} hideNavBar={true}  duration={0}/>
    <Scene key="ChatList" component={ChatList} duration={0}/>
  </Scene>
);

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
aksonovcommented, Jul 6, 2017

It is wrong usage of RNRF.

  1. Router should be TOP-LEVEL component.
  2. render* functions should be passed to “Scene” not via refresh
  3. You really should use Redux/Mobx for state management. If you want to dynamically switch from Start to Login and then to ChatList the best way is use ‘tabs’ container and Switch statement for v3 (and just Actions[KEY] for v4)

RNRF is not replacement for Redux/Mobx, it is just easy navigation. For some reasons many people try to use it as state management tool.

0reactions
abdurrahmanekrcommented, Jul 6, 2017
  • My application starts with start.js :
...
componentWillMount() {
  this.isLoggedIn();
}

isLoggedIn() {
  isLoggedIn().then((res) => {
    if (res)
      Actions.ChatList({type: 'reset'});
    else
      Actions.Login({type: 'reset'});
  });
}
...

When we go to ChatList.js by using “type: reset” command, we can come back. (“Type: reset” command is not working in v4) I am updating the navbar with “Actions.refresh” in the ChatList.js file:

...
Actions.refresh({
  renderLeftButton: () => {
    return (
      ...
    );
  },
  renderRightButton: () => {
    return (
      ...
    );
  }
})
...

:-----------------v3.39.2--------------------😐:------------------v4.0.0-beta.3----------------:

error-1  error-2

  • I need to use a view globally. I did this in the index.ios.js file. I do not know if a global view is added on router-flux. That’s why I did it in index.ios.js :
...
return (
  <View
    style={{ flex: 1 }}>
    <ConnectionBar
      show={this.state.connectionShow}
      type={this.state.connection}
      onPress={this.onClickConnectionStatus.bind(this)}/>

    <ConferenceCallPopupView
      name={this.state.conference.name}
      callHim={this.state.conference.callHim}
      callingMe={this.state.conference.callingMe}
      photo={this.state.conference.photo}
      onSelect={this.onClickConference.bind(this)}
      model={this.state.conference}
      show={this.state.conference.show}/>

    <MenuContext style={{ flex: 1}}>
      <StatusBar
        backgroundColor="#295870"
        barStyle="light-content"/>
      {/*routing*/}
      <Router>
        <Scene key="root">
          <Scene key="Start" component={Start} hideNavBar={true} duration={0}/>
          <Scene key="Login" component={Login} hideNavBar={true}  duration={0}/>
          <Scene key="ChatList" unmountScenes component={ChatList} duration={0}/>
        </Scene>
      </Router>
      {/*routing*/}
    </MenuContext>
  </View>
);
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: _reactNativeRouterFlux.Actions.goToRedeem is ...
First import Actions from react-native-router-flux import { Actions } from 'react-native-router-flux';. And you had declared your key as ...
Read more >
How to use the react-native-router-flux.Actions.push function ...
To help you get started, we've selected a few react-native-router-flux.Actions.push examples, based on popular ways it is used in public projects.
Read more >
React Native Router Flux props not passing through action ...
Coding example for the question React Native Router Flux props not passing through action-React Native.
Read more >
Using React-Native-Router-Flux with Redux | by Ian Mundy
Changing Scenes becomes simple once we've got that all set up. Let's look at the render function of our lists.js to see it....
Read more >
react-native-router-flux/CHANGELOG.md - UNPKG
The CDN for react-native-router-flux. ... 73, - is it possible to create a custom Scene instead of use original Scene? ... Actions.tab\_4 is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found