WebApps 2

main.js

main.js is a required file and is the client side entry point of the WebApp.

main.js i mainly used to hydrate the WebApp to enable client side functionality in the WebApp.

import * as React from 'react';
import ReactDOM from 'react-dom';
import App from './components/App';

export default (initialState, el) => {
  ReactDOM.hydrate(
    <App name={initialState.name} />,
    el
  );
};

The file is still required if the WebApp is rendered server side.