小编chr*_*llo的帖子

Redux商店没有有效的减速器

关于此错误,无法在此处找到任何内容:

"Store没有有效的reducer.确保传递给combineReducers的参数是一个值为reducers的对象."

我的减速机

export default function FriendListReducer(state = {friends : []}, action) {
  switch (action.type) {
    case 'ADD_FRIEND':
      return [
        { friends : action.payload.friend }, ...state.friends
      ]     
    default:
      return state;
  }
  return state;
}
Run Code Online (Sandbox Code Playgroud)

import { combineReducers } from 'redux';
import { FriendListReducer } from './FriendListReducer';

const rootReducer = combineReducers({
  friends: FriendListReducer
});
export default rootReducer;
Run Code Online (Sandbox Code Playgroud)

我的商店配置

import { applyMiddleware, createStore } from 'redux';
import thunkMiddleware from 'redux-thunk';
import createLogger from 'redux-logger';
import rootReducer from '../reducers/reducers';

export default function …
Run Code Online (Sandbox Code Playgroud)

reducers reactjs redux

27
推荐指数
3
解决办法
2万
查看次数

cursor:指向hover html5 canvas元素

无论如何要做到这一点让用户知道元素是可点击的吗?我一直在使用画架,但没有找到任何相关的东西

html5 canvas cursor

9
推荐指数
1
解决办法
1万
查看次数

Webpack生产版本无法正常工作

我在开发环境,热重装上一切正常都没问题。试图进行生产构建证明是非常具有挑战性的,只能获得空白页。这里似乎有类似的问题,但我没有使用任何html作为入口点。提前致谢。

package.json

{
  "name": "dc",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "webpack-dev-server -d --content-base public --inline --hot --host 0.0.0.0",
    "prod": "webpack -p --progress --config prod.config.js"
      },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "axios": "^0.9.1",
    "babel-core": "^6.7.2",
    "babel-loader": "^6.2.4",
    "babel-polyfill": "^6.7.4",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-react-hmre": "^1.1.1",
    "css-loader": "^0.23.1",
    "extract-text-webpack-plugin": "^1.0.1",
    "file-loader": "^0.8.5",
    "history": "^2.0.1",
    "isomorphic-fetch": "^2.2.1",
    "node-sass": "^3.4.2",
    "react": "^0.14.7",
    "react-css-transition-replace": "^1.1.0",
    "react-dom": "^0.14.7",
    "react-hot-loader": "^1.3.0",
    "react-redux": "^4.4.1",
    "react-router": "^2.0.1",
    "redux": "^3.3.1",
    "redux-logger": "^2.6.1",
    "redux-thunk": "^2.0.1",
    "sass-loader": …
Run Code Online (Sandbox Code Playgroud)

production reactjs webpack

5
推荐指数
1
解决办法
3404
查看次数

用easeljs复制对象

我一直在尝试使用easeljs库重用元素.我是否使用clone()方法,我只能得到一个实例,然后像onPress这样的事件将停止为新元素工作.

在多个容器上添加相同的对象将使对象在任何地方消失.我一直在寻找解决方法,弄乱我的代码并浪费资源.

在此先感谢任何帮助或提示.

html5 easeljs createjs

1
推荐指数
1
解决办法
6866
查看次数

标签 统计

html5 ×2

reactjs ×2

canvas ×1

createjs ×1

cursor ×1

easeljs ×1

production ×1

reducers ×1

redux ×1

webpack ×1