Skip to content

Question on Client.js #85

@codestitch

Description

@codestitch

I'm a newbie and would like to ask regarding client.js code.

import React from 'react';
import ReactDOM from 'react-dom';
import { AppContainer } from 'react-hot-loader';
import { Provider } from 'react-redux';
import App from './containers/App';
import configureStore from './stores';

const store = configureStore();
ReactDOM.render(
<AppContainer>
<Provider store={store}>
<App />
</Provider>
</AppContainer>,
document.getElementById('app')
);

// what's the use of this?
if (module.hot) {
module.hot.accept('./containers/App', () => {
const NextApp = require('./containers/App').default; // eslint-disable-line global-require
ReactDOM.render(
<AppContainer>
<Provider store={store}>
<NextApp />
</Provider>
</AppContainer>,
document.getElementById('app')
);
});
}

What's the use of this one in module.hot?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions