Configure Express / React / Babel to Work with React Universal Component

Tim Kindberg
InstructorTim Kindberg
Share this video with your friends

Social Share Links

Send Tweet
Published 7 years ago
Updated 6 years ago

We’ll make the configuration changes needed in our express server, babel configuration, and react app code to get universal components working. We'll go from typical configurations to a "universal" configuration. We'll need our express app to use the webpack hot server middleware to serve our custom html. We'll use the flushChunks method to discover which javascript and css files actually need to be sent down to the client on initial render. We need to add the stage-2 babel plugin so that we can use the import function. And we can't forget to hydrate our React app on the client after we receive the serverside-rendered html.