Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've been doing React for a while now and I've ended up with the same structure: 2 main folders.

One of them in the base components, which are in folders grouped by their corresponding REST service endpoint (so if you have 'Foo' and 'Bar' db tables, and API's, then I have 'Foo' and 'Bar' folders inside my 'components' folder.

The other folder is my views. It's more of the integration layer for all of my components. Since views typically correspond to a page route, that's where most of my react-router stuff is. It also is where I call the react-redux 'connect' HOC, to get data that is fed down into the components.

So far it's working pretty well for me. I think it works great for a medium-size type of app.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: