Настроил css модули

This commit is contained in:
SleepWalker
2016-01-03 11:11:08 +02:00
parent 60ebce5284
commit 0a750b8cfa
5 changed files with 54 additions and 19 deletions

View File

@@ -3,9 +3,15 @@ import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore, combineReducers } from 'redux';
import { createStore, combineReducers, applyMiddleware } from 'redux';
import { Provider as ReduxProvider } from 'react-redux';
// midleware, который позволяет возвращать из экшенов функции
// это полезно для работы с асинхронными действиями,
// а также дает возможность проверить какие-либо условия перед запуском экшена
// или даже вообще его не запускать в зависимости от условий
import thunk from 'redux-thunk';
import { Router, browserHistory } from 'react-router';
import { syncReduxAndRouter, routeReducer } from 'redux-simple-router';
@@ -18,7 +24,10 @@ const reducer = combineReducers({
...reducers,
routing: routeReducer
});
const store = createStore(reducer);
const store = applyMiddleware(
thunk
)(createStore)(reducer);
syncReduxAndRouter(browserHistory, store);

3
src/index.scss Normal file
View File

@@ -0,0 +1,3 @@
.testClass {
background: #f00;
}

View File

@@ -4,6 +4,8 @@ import { Link } from 'react-router';
import { FormattedMessage } from 'react-intl';
import styles from 'index.scss';
function CoreLayout(props) {
return (
<div>
@@ -23,7 +25,7 @@ function HomeView() {
return (
<div>
Home!
<Link to="/auth">Auth</Link>
<Link className={styles.testClass} to="/auth">Auth</Link>
</div>
);
}