3 ms·
CRA's default template gives you several files in `/src`. In the default template, most of those files are intended as examples: - `index.js` is required as t
by acemarke 7y ago
CRA's default template gives you several files in `/src`. In the default template, most of those files are intended as examples:
- `index.js` is required as the entry point for the app
- `App.js` is the main app component
- `App.test.js` shows you can write a test for a component
- `App.css` shows you can import CSS files directly into the JS to have it included in the output
You can begin editing those files, or just delete all but `index.js` and start writing your own.
Many folks who have used CRA will just immediately delete those. Beyond that, some folks have forked the `react-scripts` package just to set up a different project source template.
Adding an option to specify a template means that other folks can now publish their own CRA-compatible project source templates and have them work with CRA right away. For example, I'm a Redux maintainer, and we could create a CRA template that already has a dependency on Redux (or our new Redux Toolkit package), all set up and ready to go without the user having to manually install them.
The different package tools mentioned in the release notes serve different purposes. `npm` and `yarn` are competing JS package managers. They both install and update packages from the NPM registry, with some different features available. `npx` comes with the `npm` tool, and is a way to quickly run CLI packages like `create-react-app` without having to explicitly run a separate "install this globally" command first.
- davedx 7y agoThanks for the breakdown! I find it really difficult to track everything that's going on in the react ecosystem. I realise for many people 'npx' is something that's been available for a while now but it's one of the many things I haven't had time to look at yet
- darekkay 7y agoI am using redux-starter-kit in one of my projects and I was curious about the "Redux Toolkit" package you mentioned. I have somehow missed the change of name, but I find it more fitting now. Highly recommended, even for experienced Redux users.
- acemarke 7y agoYeah, we changed the name from "Redux Starter Kit" to "Redux Toolkit" because folks were misinterpreting the word "Starter" to mean that it was a CLI tool like CRA, or that it was only good for beginners. Didn't want the churn, especially since it was after RSK had hit 1.0, but we had enough people telling us "I didn't even look at it because of the word 'Starter' in the name" that it was clear that had to change. Fortunately, the feedback on the name change has been almost universally positive. And yes, RTK is intended to be useful for both new and experienced Redux users [0], and we're now recommending it as the default standard way to write Redux logic [1]. See the RTK v1.0.4 release notes [2] for the details on the name change. [0] https://redux-toolkit.js.org/introduction/quick-start https://redux-toolkit.js.org/introduction/quick-start [1] https://redux.js.org/style-guide/style-guide#use-redux-toolkit-for-writing-redux-logic https://redux.js.org/style-guide/style-guide#use-redux-toolk... [2] https://github.com/reduxjs/redux-toolkit/releases/tag/v1.0.4 https://github.com/reduxjs/redux-toolkit/releases/tag/v1.0.4
- cercatrova 7y agoReact Toolkit is so good, I've been following the advanced tutorial with TypeScript and it makes Redux so much cleaner. Thank you!