I'm struggling with folder structure of my react native app. My app is a simple form app and doesn't use redux. My folder structure is below:
App.js
index.js
package.json
Yes, I didn't add any files... I searched on google, but I found only folder structure with redux. I wrote almost all my code in App.js, but I think it is becoming complex a bit. I want to know where to move logics from App.js.
My App.js is like this:
some import codes here
export default class App extends Component{
super()
this.state={//init state}
initState(){
//initialize state
//this is called when the submit button is pushed
}
onPress(){
//this function is called when the submit button is pushed
}
render(){
return(
//a lot of inputs here like id, name, email, date, comment...
//I think I can divide these inputs as components
)
}
const styles = StyleSheet.create({
//style sheets here
})
}
I want to know
- Where to put my "onPress" or "initState" or some other functions.
- How to divide simple form inputs to components
- Whether I can remove stylesheets from App.js or not and where to put them
Thanks.