I am using:
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}
/>
)
https://i.stack.imgur.com/Lfjkp.png
Is something wrong with the set up?
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.