/* global STRIPE_API_KEY */
import React from 'react'
import ReactDOM from 'react-dom'
import {Provider} from 'react-redux'
import Router from './router'
import history from './router/history'
import store from './store'
import initialize from 'global/utils/initialize'
import {StripeProvider} from 'react-stripe-elements'
import '@equitysim/react-uikit/dist/styles.css'
// // Tool to see what is causing rerenders
// // https://github.com/welldone-software/why-did-you-render
// if (process.env.NODE_ENV === 'staging') {
//     const whyDidYouRender = require('@welldone-software/why-did-you-render')

//     whyDidYouRender(React)
// }

// Running initializing steps before mounting the app.
initialize().then(() => {
    ReactDOM.render(
        <Provider store={store}>
            <StripeProvider apiKey={STRIPE_API_KEY}>
                <Router history={history} store={store} />
            </StripeProvider>
        </Provider>,
        document.getElementById('react-root')
    )
})
