Factor our getting root node into utils fn

Co-authored-by Jared Scheib <jared.scheib@gmail.com>
Co-authored-by Brandon Farmer <bthesorceror@gmail.com>
pull/10616/head
Jared Scheib 2018-04-06 13:00:01 -07:00
parent cf7be217d2
commit 94835f36f7
2 changed files with 4 additions and 1 deletions

View File

@ -11,6 +11,8 @@ import {bindActionCreators} from 'redux'
import configureStore from 'src/store/configureStore' import configureStore from 'src/store/configureStore'
import {loadLocalStorage} from 'src/localStorage' import {loadLocalStorage} from 'src/localStorage'
import {getRootNode} from 'src/utils/nodes'
import App from 'src/App' import App from 'src/App'
import { import {
Login, Login,
@ -48,7 +50,7 @@ import {HEARTBEAT_INTERVAL} from 'src/shared/constants'
const errorsQueue = [] const errorsQueue = []
const rootNode = document.getElementById('react-root') const rootNode = getRootNode()
declare global { declare global {
interface Window { interface Window {

1
ui/src/utils/nodes.ts Normal file
View File

@ -0,0 +1 @@
export const getRootNode = () => document.getElementById('react-root')