官术网_书友最值得收藏!

Creating a new React project from scratch

There's a standard template for creating React apps: the create-react-app application template. This includes some standard dependencies and boilerplate code that all React applications need. However, it also contains some extra items such as favicon.ico, a sample logo, and CSS files. While these are undoubtedly useful, having them here at the very start of a project is at odds with one of the test-driven developer's core principles: You Ain't Gonna Need It (YAGNI).

This principle says that you should hold off adding anything to your project until you're really sure that it's necessary. Perhaps that's when your team adds a user story for it into the iteration, or maybe it's when a customer asks for it. Until then, YAGNI.

It's a theme that runs throughout this book and we'll start right now by choosing to avoid create-react-app. You can always start every JavaScript project from scratch, and there's a certain joy to be found in going over the basics each time.

主站蜘蛛池模板: 泰安市| 威远县| 徐闻县| 乐昌市| 沙雅县| 文山县| 理塘县| 淮南市| 蒙自县| 新平| 万山特区| 佛冈县| 合阳县| 岐山县| 商南县| 佛山市| 嫩江县| 吉木萨尔县| 六安市| 甘孜| 南阳市| 陇川县| 榆树市| 汉寿县| 大关县| 宜兰市| 光山县| 苏尼特右旗| 宣武区| 清流县| 巫溪县| 大英县| 利津县| 富民县| 当阳市| 临澧县| 宣恩县| 肇东市| 河东区| 水富县| 佛山市|