Gab-Social/app/javascript/gabsocial/main.js
mgabdev 43e384554c Remove React, PureComponent global import, added those imports to files directly
• Remove:
- React, PureComponent global import and added those imports to files directly
2020-08-17 15:07:16 -05:00

24 lines
731 B
JavaScript

'use strict';
import React from 'react'
import ReactDOM from 'react-dom';
import ready from './ready';
import * as registerPushNotifications from './actions/push_notifications';
import { default as GabSocial, store } from './containers/gabsocial';
function main() {
ready(() => {
const mountNode = document.getElementById('gabsocial');
const props = JSON.parse(mountNode.getAttribute('data-props'));
ReactDOM.render(<GabSocial {...props} />, mountNode);
if (process.env.NODE_ENV === 'production') {
// Avoid offline in dev mode because it's harder to debug
require('offline-plugin/runtime').install();
store.dispatch(registerPushNotifications.register());
}
});
}
export default main;