diff --git a/assets/js/dashboard/error-boundary.js b/assets/js/dashboard/error-boundary.js
new file mode 100644
index 000000000..e10fdccc5
--- /dev/null
+++ b/assets/js/dashboard/error-boundary.js
@@ -0,0 +1,26 @@
+import React from 'react';
+import RocketIcon from './stats/modals/rocket-icon'
+
+export default class ErrorBoundary extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {error: null}
+ }
+
+ static getDerivedStateFromError(error) {
+ return {error: error}
+ }
+
+ render() {
+ if (this.state.error) {
+ return (
+
+
+
Oops! Something went wrong
+
{this.state.error.name + ': ' + this.state.error.message}
+
+ )
+ }
+ return this.props.children;
+ }
+}
diff --git a/assets/js/dashboard/mount.js b/assets/js/dashboard/mount.js
index b62775355..5799b4e18 100644
--- a/assets/js/dashboard/mount.js
+++ b/assets/js/dashboard/mount.js
@@ -3,6 +3,7 @@ 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')
@@ -13,5 +14,11 @@ if (container) {
hasGoals: container.dataset.hasGoals === 'true'
}
- ReactDOM.render(, container);
+ const app = (
+
+
+
+ )
+
+ ReactDOM.render(app, container);
}