From 94835f36f78a6d1a6c7e4b964e581b4bd38c08fa Mon Sep 17 00:00:00 2001 From: Jared Scheib Date: Fri, 6 Apr 2018 13:00:01 -0700 Subject: [PATCH] Factor our getting root node into utils fn Co-authored-by Jared Scheib Co-authored-by Brandon Farmer --- ui/src/index.tsx | 4 +++- ui/src/utils/nodes.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 ui/src/utils/nodes.ts diff --git a/ui/src/index.tsx b/ui/src/index.tsx index bf51448bc1..907c071ddc 100644 --- a/ui/src/index.tsx +++ b/ui/src/index.tsx @@ -11,6 +11,8 @@ import {bindActionCreators} from 'redux' import configureStore from 'src/store/configureStore' import {loadLocalStorage} from 'src/localStorage' +import {getRootNode} from 'src/utils/nodes' + import App from 'src/App' import { Login, @@ -48,7 +50,7 @@ import {HEARTBEAT_INTERVAL} from 'src/shared/constants' const errorsQueue = [] -const rootNode = document.getElementById('react-root') +const rootNode = getRootNode() declare global { interface Window { diff --git a/ui/src/utils/nodes.ts b/ui/src/utils/nodes.ts new file mode 100644 index 0000000000..37aafeafba --- /dev/null +++ b/ui/src/utils/nodes.ts @@ -0,0 +1 @@ +export const getRootNode = () => document.getElementById('react-root')