Breaking down react files

Hi,

I just finished your leaning react book. I started in on a “larger” project and it quickly is getting messy.

Is there a way to break each React.createClass(

into its own file and import it?

Thanks,

Yes there is! I am in the process of covering that in the 2nd edition, but here is the first step: https://www.kirupa.com/react/setting_up_react_environment.htm

You can break up all of your components into individual classes. The example in that tutorial and the others listed under Learning By Doing should help you further: https://www.kirupa.com/react/index.htm

:grinning:

Thanks, exactly what I needed. And the book was great btw :slight_smile:

1 Like