React-native-router-flux: Getting Unhandled JS Exception: undefined is not an object (evaluating 'child.props.clone')

Created on 8 Aug 2017  路  5Comments  路  Source: aksonov/react-native-router-flux

I am using:

  • react-native-router-flux v4.0.0-beta.17
  • react-native v0.4.6
  • react v16.0.0-alpha.12
  • react-native 0.46.1

Wanted to setup a new react native application and installed react-native-router-flux.

scenes.js have the following:

import { Actions, Scene } from 'react-native-router-flux'
import Routes from '../routes/index'

console.log("Routes", Routes);

const createScenes = () => {
    return Routes.childRoutes.map((route)=>{
        return <Scene
                key={route.path}
                component={route.component}
                title={route.title} 
               />
    });
}

const navigationBarStyle = {
  backgroundColor: 'white'
}

const scenes = Actions.create(
  <Scene key="app" navigationBarStyle={navigationBarStyle}>
    <Scene
        key={Routes.indexRoute.path}
        component={Routes.indexRoute.component}
        title={Routes.indexRoute.title} />
    {createScenes()}
  </Scene>
)

export default scenes

in my router.js I have this:

import { Router } from 'react-native-router-flux'
import scenes from './scenes'

const getSceneStyle = () => ({
  flex: 1,
  backgroundColor: '#fff',
  shadowColor: 'black',
  shadowOffset: { width: 2, height: 4 },
  shadowOpacity: 0.7,
  shadowRadius: 5,
})

export default () => (
  <Router
    scenes={scenes}
    getSceneStyle={getSceneStyle}
  />
)

Actual behaviour

https://i.stack.imgur.com/Lfjkp.png

Is something wrong with the set up?

All 5 comments

It is incorrect usage createScenes should not be function, just list all your scenes directly. Check Example project

@aksonov Can you try to help us please, i have this same issue :(

@andela-Jaderibigbe Man, what did you do to fix this issue ???? help :(

Same error here

Just check latest beta.31 and Example project.

@AlbertoIHP As I mentioned it is incorrect usage, you must list scenes directly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

basdvries picture basdvries  路  3Comments

maphongba008 picture maphongba008  路  3Comments

wootwoot1234 picture wootwoot1234  路  3Comments

booboothefool picture booboothefool  路  3Comments

xnog picture xnog  路  3Comments