Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Customize Babel to Build a React App with Poi

    John LindquistJohn Lindquist

    Developing React with Poi is as easy as adding the babel-preset-react-app to a .babelrc and installing React. This lesson will walk you through that quick process and get your React app up-and-running.



    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson




    Instructor: Switching over to React is as easy as installing React and ReactDOM, then, install babel-preset-react app. I like the babel plug-in react require, and save these as devDependencies. I'll delete this, add a babelrc, which poi will automatically pick up.

    Say my presets are React app, and my plug-ins are React require. Then, go into my index, I'll select all, import from ReactDOM. We'll need to grab the render method. I can skip importing React because of the React require plug-in.

    Then, say render. We'll pass in a div, say React, and then, we'll get the element by ID of app. Hit save there, run poi, and we have a React app, which will auto-reload anytime I make a change.