Cleanup and file reorganization

This commit is contained in:
Tom Raithel
2017-02-20 19:33:39 +01:00
parent 6cfd53a47a
commit 9f33c7a8ca
30 changed files with 176 additions and 446 deletions

25
js/client.js Normal file
View File

@@ -0,0 +1,25 @@
import React from 'react'
import { render } from 'react-dom'
import { createStore } from 'redux'
import { Provider } from 'react-redux'
import App from './components/App'
const appReducer = (state = {}, action) => {
return state;
}
// Grab the state from a global variable injected into the server-generated HTML
const preloadedState = window.__TECHRADAR__;
// Allow the passed state to be garbage-collected
delete window.__TECHRADAR__;
// Create Redux store with initial state
const store = createStore(appReducer, preloadedState)
render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
)