Re:React.js Introduction for People Who Know Just Enough JQuery
by marknutter on Thursday July 09, 2015 @12:10PM
(#9858769)
I think it's all fine and dandy, and I like the idea of isolated components, but I'm not sold on shoving everything into one file. It just smacks of preference.
[ Parent
| on HN ]
Re:React.js Introduction for People Who Know Just Enough JQuery
by misuba on Thursday July 09, 2015 @02:23PM
(#9859755)
So split it up. Most React projects make use of Webpack or Browserify, or use ES6 modules via Babel. There are emerging patterns for keeping concerns in separate places but still having one component you can drop in declaratively.
Re:React.js Introduction for People Who Know Just Enough JQuery
by mateuszf on Thursday July 09, 2015 @04:54PM
(#9860615)
One file per one component sounds like a better representation of one real world concept using code. It translates 1 to 1.
Re:React.js Introduction for People Who Know Just Enough JQuery
by marknutter on Friday July 10, 2015 @08:48AM
(#9863606)
Then just put all the files for a component into a single folder, which translates 1 to 1. Again, this is all just a matter of preference, and with pre-compilers you could glob all your js/css/html into one file using any framework if you really wanted to. Seems silly to me, but to each their own.