Generate even less code?
See original GitHub issueFrom @remy’s amazing First Impressions of React, this paragraph made me sad:
I had a couple of false starts with trying create-react-app, react-boilerplate and another that I forget.
The reason for the false starts is that they contained way too much code and structure and expected understanding. I believe they’ll be super useful once there’s some understanding and ability to navigate the logic behind React apps, but for starting out, I needed to be closer to the metal, I needed to see the direct output of my coding efforts.
Is there anything we could do to better match your use case? These are the files we generate by default. We opted for a bare minimum, just enough to render a single component.
Here’s what we generate:
.gitignore # good defaults
package.json # needed for npm
README.md # tips and usage guide
index.html # your page
src/index.js # entry point to show where to put side effects on launch
src/index.css # put global CSS here
src/App.js # an example component
src/App.css # an example component stylesheet
src/App.test.js # an example component test
src/logo.svg # an image so you know how to import media assets in code
Should we cut something?
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (6 by maintainers)
Top GitHub Comments
I’m a react beginner and imo create-react-app has the perfect amount of files. Every file has been useful to me to demonstrate how to do something. I think it strikes the perfect balance between too much and too little.
On Wednesday, 14 September 2016, Dan Abramov notifications@github.com wrote:
Best Regards,
Huy Do XBITS
P: (02) 8215 0661 E: huy@xbits.com.au
@hummlas no, I think you’re on point with your comments, and I was waiting for the discussion to settle a bit before coming back in.
I think it’s important to keep in mind who CRA is for. My comments (in my blog) might be useful, it might not be. My sense is that CRA is for beginners on their journey to learning React.
I was approaching it exactly as @markerikson suggests, very close to a REPL, and wanting to see the effect of change quickly.
Thinking now, the way to tackle this kind of audience might actually just be in the README me, somewhere clearly stating “if you just want to try it out, try this …”. I found gist fascinating, it got me React with JSX in two files and it all just worked (obviously I looked under the hood and I was pulling 2mb of script, but that’s fine for a bit of dabbling).
I hope that helps a little!