server.js

import express from 'express';
import exphbs from 'express-handlebars';
import React from 'react';
import ReactDOMServer from 'react-dom/server';

const app = express();

app.engine('hbs', exphbs({extname: '.hbs'}));
app.set('view engine', 'hbs');

app.use(express.static('public'));

app.get('/', (req, res) => {
    const state = { headline: 'Hello World!' };

    res.render('index', {
        app: ReactDOMServer.renderToString(<App {...state} />),
        state: JSON.stringify(state)
    });
});