analytics/assets/js/dashboard/mount.js
2020-07-15 12:16:16 +03:00

25 lines
538 B
JavaScript

import React from 'react';
import ReactDOM from 'react-dom';
import 'url-search-params-polyfill';
import Router from './router'
import ErrorBoundary from './error-boundary'
const container = document.getElementById('stats-react-container')
if (container) {
const site = {
domain: container.dataset.domain,
offset: container.dataset.offset,
hasGoals: container.dataset.hasGoals === 'true'
}
const app = (
<ErrorBoundary>
<Router site={site} />
</ErrorBoundary>
)
ReactDOM.render(app, container);
}