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

  • Getting Started with React
  • Doel Sengupta Manu Singhal Danillo Corvalan
  • 473字
  • 2021-07-16 11:09:20

Tools

The community has already developed a bunch of tools to improve our coding experience and productivity. In this section, we'll get through some text editors, their packages, and a browser extension created to improve debugging applications in ReactJS.

Text editors

Most of the text editors available today provide syntax highlighting for JSX and useful snippets and helpers for ReactJS. Here are some text editors that I suggest using:

Sublime Text requires a paid license although it works in free mode, always showing a popup that might trouble you from time to time. Also, you will need to install its package manager separately. You can find sublime Text packages and more information on how to install its package manager at https://packagecontrol.io/. Once the Sublime editor is installed, go to the installed directory, and you can open Sublime from the terminal by running subl in the directory that your are in and you will open the files of the current directory in Sublime.

Atom is recent and free and was made by GitHub. It comes with a package manager included and there is no need to install it separately. You just need to go to the settings and install the React package. It comes with syntax highlights, snippets, and so on. The only problem I've experienced using Atom on a MacOS X Yosemite is that the font quality looks poorer than that in Sublime Text. If you face it, you just need to uncheck the Use Hardware Acceleration option in Atom's settings.

Brackets is also free and has a lot of great features such as live preview; for example, you can edit your code files and see the changes being applied in the browser. Brackets has a built-in extension manager, and you can install ReactJS JSX syntax highlighting as well. However, at the time of writing this book, some highlighting features were not working well.

All of these text editors are pretty good and have lots of features, but it's not the purpose of this book to show them. Feel free to choose one if you don't have a preferred text editor already.

Chrome extension

The ReactJS team created a browser extension for Google Chrome. It allows you to inspect the component hierarchy, and it helps a lot when you need to debug your application. You can open Chrome Web Store, search for React Developer Tools, and install it. You need to open Chrome Developer Tools (F12 on Windows and Linux, ?-Option-I on Mac) to use the extension. We're going to use the extension in later chapters to understand the ReactJS component hierarchy. In order to have the React extension/add-on work in Chrome/Firefox, we need to have a React component globally available on the web page.

主站蜘蛛池模板: 桃江县| 长子县| 鹤山市| 宽甸| 怀仁县| 邯郸县| 石河子市| 阳原县| 吐鲁番市| 申扎县| 曲松县| 岢岚县| 巴马| 沙坪坝区| 长沙市| 农安县| 馆陶县| 泗水县| 灌南县| 方正县| 巴马| 广宗县| 东莞市| 阳高县| 商水县| 永吉县| 凤城市| 阳城县| 肇庆市| 乐陵市| 鹤庆县| 邢台县| 甘孜| 公主岭市| 临湘市| 望谟县| 宣城市| 如皋市| 竹山县| 资中县| 合川市|