I develop a mobile application with react native. I use react-native-router-flux
and my App.js
like this.
import React, { Component } from "react";
import { Router, Scene } from "react-native-router-flux";
import A from './pages/A';
import B from './pages/B';
import C from './pages/C';
import D from './pages/D';
import E from './pages/E';
import F from './pages/F';
//... and if i add new page here add new import
class App extends Component {
render(){
return (
<Router>
<Scene key="root" >
<Scene key="AA" component={A} ... Other properties />
<Scene key="BB" component={B} ... Other properties />
<Scene key="CC" component={C} ... Other properties />
<Scene key="DD" component={D} ... Other properties />
... other scenes items here
</Scene>
</Router>
);
}
}
export default App;
Can I put all import a file like this example AllPagesImport.js
import B from './pages/B';
import C from './pages/C';
import D from './pages/D';
import E from './pages/E';
import F from './pages/F';
and I again call this file in App.js
import AllPagesImportfrom './AllPagesImport'
it's possible or has any alternative solution?
Also, I try when application start all import put a render import method but it's didn't work