Hey, I need to create a page that displays the latest activity from the users, so I just need to get the data from the REST endpoint and display it in some sort of filterable table, and update it if anything changes in the server. I was thinking maybe using jQuery to fetch and display the data?
-Sure, you could still use jQuery. But if you’re ever planning to do something more complicated on the frontend you should probably try React. It will be a big benefit for you in the future.
-Sounds great. How can i start with React?
-The easiest way is to run npm install create-react-app -g in your terminal and you can start with a project right away.
-Cool, so you’re telling me that I don’t need any additional setup?
-Do I need to install any special IDE like Visual Studio, Android Studio, or Xcode?
-Nope, just create your app with create-react-app my-cool-app and you’re good to go.
-But what about extra dependencies? Do I maybe need to install Java on my machine? Maybe I also need Maven, Gradle, CocoaPods, or maybe I need to download some extra 20gb SDK?
-Nope, just cd into your app and start it with npm start. That’s it.
-But do I have to build my app and wait for a long rebuild every time i change something?
-Nope. If you do a change the page will automatically refresh for you. If you change some CSS it will be live-reloaded for you, without doing a full page refresh.
-Sounds very useful! I think it can speed up my development process a bit. But wait, what do i do if i ever want to deploy a production version of my website? Because no one is *actually* deploying an unminified version of index.html, app.css, and main.js in production anymore, right?
-Yup, you’re right. If you ever want to deploy a production version of your site just run npm run build and everything that you need will be in your /build folder. Minified, optimised, and ready for deployment.
-Thanks dude, that was very helpful.
*curtain falls down, applause and cheers from the audience, our 2 developers take a bow, shake hands, and ride off on dragons into the sunset*
Let’s have fun and spread a bit more positivity and happiness in the JS community. If you want to know how to add a simple configuration to create-react-app without ejecting it read my latest post.
If you, or someone you know is interested in a professional React workshop, check out React Academy.
EDIT: Just because it’s unclear to some folks, this article 👆 is a response to this article.