Skip to content

Can not read property '<functionname>' of undefined when using onBack in prerendered scenes #1352

Closed
@SebasJK

Description

@SebasJK

Version

Tell us which versions you are using:

  • react-native-router-flux v^3.36.0
  • react-native v0.35.0

Expected behaviour

Expected sucessfull call to the function '_someFunction', as when the Scenes are placed directly within de router: as such:


<Scene key="login" component={Login} title="Login" onBack={ ()=>this._someFunction() } />



Where '_someFunction' is a function of "class App extends Component{ }"

Actual behaviour

Can not read property '' of undefined

const scenes = Actions.create(

<Scene key="login" component={Login} title="Login" onBack={ ()=>this._someFunction() } />



)

Steps to reproduce

  1. recreate sample from https://github.com/aksonov/react-native-router-flux
  2. add onBack as shown and the function '_someFunction' within class App extends Component
  3. use const scenes = Actions.create( ... )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions