Update React MusicStore sample to use current technologies (TypeScript 2, .NET Core 1.0.1, etc.). Fixes #417

This commit is contained in:
SteveSandersonMS
2016-11-07 10:16:41 -08:00
parent 7ee8a7b15e
commit 1b4dd93fa6
21 changed files with 142 additions and 4687 deletions

View File

@@ -1,21 +1,25 @@
import './styles/styles.css';
import 'bootstrap/dist/css/bootstrap.css';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { browserHistory, Router } from 'react-router';
import { Provider } from 'react-redux';
React; // Need this reference otherwise TypeScript doesn't think we're using it and ignores the import
import './styles/styles.css';
import 'bootstrap/dist/css/bootstrap.css';
import configureStore from './configureStore';
import { syncHistoryWithStore } from 'react-router-redux';
import { routes } from './routes';
import configureStore from './configureStore';
import { ApplicationState } from './store';
// Get the application-wide store instance, prepopulating with state from the server where available.
const initialState = (window as any).initialReduxState as ApplicationState;
const store = configureStore(browserHistory, initialState);
const store = configureStore(initialState);
const history = syncHistoryWithStore(browserHistory, store);
// This code starts up the React app when it runs in a browser. It sets up the routing configuration
// and injects the app into a DOM element.
ReactDOM.render(
<Provider store={ store }>
<Router history={ browserHistory } children={ routes } />
<Router history={ history } children={ routes } />
</Provider>,
document.getElementById('react-app')
);