Getting (re)Started with React in Summer 2017
Inspired by the Bell Brothers use of Angular at jen.lu, I’ve concluded that, while I still have some old-school reservations on new screen readers vs. Section 508, it’s OK in some markets to bake more javascript into my next more-of-a-website-than-an-app Wordpress project. It’s been almost two years since I started my first React app, things have changed, and here’s what’s working for me now — these things might be helpful to you:
1. N
install -g n
sudo n latestI found n to be slightly easier to use than nvm. It enabled me to, with less errors, appease create-react-app…
2. Create-react-app
Create-react-app sets up a development environment on your local machine in one step. It just worked. I admit to not knowing how everything worked, but it did. I am simultaneously glad that this didn’t exist, and wish that it did, when I started with React. It also helps you create files to deploy to a production server. Here’s how to install it and create an app:
npm install -g create-react-app
create-react-app my-appHere’s how to run the development server, which opens a browser to http://localhost:3000/ and turns the terminal into an error console:
cd my-app
npm startOnce started, the browser automatically refreshes the app when changes to the app code and css are made. When you are ready to deploy, run npm run build which puts package of files in a build folder.
3. Atom
I’m still using atom. It, and many packages, are much more stable than they used to be. Here are some packages I have used in the past and are active on my machine:
- Remote-FTP
I use this occasionally when I’m not using Transmit to map SFTP locations as drives - Atom-JSX-Transform
So, create-react-app may replace this TBD - Less-Autocompile
Hey, LESS ain’t that much worse than SCSS…. - React
For syntax support - Sass Autocompile
(2018 Update)
4. Deployment
If you are creating a single-page web application, you might be interested in now or surge or github pages. For my more-website-than-app thing I’m making now, I would like one less service to deal with, and therefore need to get my files to the host where Wordpress is, and have not found the perfect tool yet, but continue to use Transmit. I’m going to see how reliable npm run build works with it soon.
What’s next?
For this project, hopefully:
