Aya
Aya

Reputation: 13

folder structure of react native app without redux

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

Thanks.

Upvotes: 0

Views: 992

Answers (1)

Dheeraj Chaudhary
Dheeraj Chaudhary

Reputation: 71

I have worked on several apps with different different folder structure with or without redux. But I found this folder structure very helpful.This structure also helps in large scale application as well for small scale applications.

Fractal — A react app structure for infinite scale

https://hackernoon.com/fractal-a-react-app-structure-for-infinite-scale-4dab943092af

Upvotes: 1

Related Questions