aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/assets/index.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard/assets/index.jsx')
-rw-r--r--dashboard/assets/index.jsx29
1 files changed, 17 insertions, 12 deletions
diff --git a/dashboard/assets/index.jsx b/dashboard/assets/index.jsx
index 1e5fdc892..e10095baf 100644
--- a/dashboard/assets/index.jsx
+++ b/dashboard/assets/index.jsx
@@ -1,3 +1,5 @@
+// @flow
+
// Copyright 2017 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
@@ -15,22 +17,25 @@
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
import React from 'react';
-import {hydrate} from 'react-dom';
-import {createMuiTheme, MuiThemeProvider} from 'material-ui/styles';
+import {render} from 'react-dom';
+
+import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
+import createMuiTheme from 'material-ui/styles/createMuiTheme';
-import Dashboard from './components/Dashboard.jsx';
+import Dashboard from './components/Dashboard';
-// Theme for the dashboard.
const theme = createMuiTheme({
palette: {
type: 'dark',
},
});
-
-// Renders the whole dashboard.
-hydrate(
- <MuiThemeProvider theme={theme}>
- <Dashboard />
- </MuiThemeProvider>,
- document.getElementById('dashboard')
-);
+const dashboard = document.getElementById('dashboard');
+if (dashboard) {
+ // Renders the whole dashboard.
+ render(
+ <MuiThemeProvider theme={theme}>
+ <Dashboard />
+ </MuiThemeProvider>,
+ dashboard,
+ );
+}