Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"stage": 0
}
"presets": ["es2015", "stage-0", "react"]
}
32 changes: 18 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"name": "react-hot-boilerplate",
"version": "1.0.0",
"description": "Boilerplate for ReactJS project with hot code reloading",
Expand Down Expand Up @@ -28,26 +28,30 @@
},
"homepage": "https://github.com/gaearon/react-hot-boilerplate",
"devDependencies": {
"babel-core": "^5.8.3",
"babel-eslint": "^4.0.5",
"babel-loader": "^5.3.2",
"babel-core": "^6.0.20",
"babel-eslint": "^4.1.3",
"babel-loader": "^6.0.1",
"babel-preset-es2015": "^6.0.15",
"babel-preset-react": "^6.0.15",
"babel-preset-stage-0": "^6.0.15",
"css-loader": "^0.15.6",
"cssnext-loader": "^1.0.1",
"eslint": "^0.24.1",
"eslint-plugin-react": "^3.1.0",
"extract-text-webpack-plugin": "^0.8.2",
"eslint": "^1.10.1",
"eslint-plugin-react": "^3.6.2",
"extract-text-webpack-plugin": "^0.9.1",
"html-webpack-plugin": "^1.6.1",
"react-hot-loader": "^1.2.7",
"redux-devtools": "^1.0.2",
"react-hot-loader": "^1.3.0",
"redux-devtools": "^2.1.5",
"style-loader": "^0.12.3",
"webpack": "^1.9.6",
"webpack-dev-server": "^1.8.2"
"webpack": "^1.12.2",
"webpack-dev-server": "^1.12.1"
},
"dependencies": {
"classnames": "^2.1.3",
"lodash": "^3.10.1",
"react": "^0.13.0",
"react-redux": "^0.2.2",
"redux": "^1.0.0-rc"
"react": "^0.14.0",
"react-dom": "^0.14.0",
"react-redux": "^4.0.0",
"redux": "^3.0.4"
}
}
4 changes: 2 additions & 2 deletions src/components/FriendList.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component, PropTypes } from 'react';
import mapValues from 'lodash/object/mapValues';
import map from 'lodash/collection/map';

import styles from './FriendList.css';
import FriendListItem from './FriendListItem';
Expand All @@ -14,7 +14,7 @@ export default class FriendList extends Component {
return (
<ul className={styles.friendList}>
{
mapValues(this.props.friends, (friend) => {
map(this.props.friends, (friend) => {
return (<FriendListItem
key={friend.id}
id={friend.id}
Expand Down
4 changes: 2 additions & 2 deletions src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export default class App extends Component {
return (
<div>
<Provider store={store}>
{() => <FriendListApp /> }
<FriendListApp />
</Provider>

{renderDevTools(store)}
{ renderDevTools(store) }
</div>
);
}
Expand Down
17 changes: 12 additions & 5 deletions src/containers/FriendListApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@ import { connect } from 'react-redux';
import * as FriendsActions from '../actions/FriendsActions';
import { FriendList, AddFriendInput } from '../components';

@connect(state => ({
friendlist: state.friendlist
}))
export default class FriendListApp extends Component {
class FriendListApp extends Component {

static propTypes = {
friendsById: PropTypes.object.isRequired,
// friendsById: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired
}

Expand All @@ -29,3 +26,13 @@ export default class FriendListApp extends Component {
);
}
}


// Babel 6.x doesn't seem to support decorators yet
function select(state) {
return {
friendlist: state.friendlist
}
}

export default connect(select)(FriendListApp)
5 changes: 2 additions & 3 deletions src/store_enhancers/devTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ if (__DEV__) {
require('redux-devtools').devTools(),
require('redux-devtools').persistState(
window.location.href.match(/[?&]debug_session=([^&]+)\b/)
),
createStore
);
)
)(createStore);
}

export function renderDevTools(store) {
Expand Down