Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/411.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何用“解决问题”;找不到店铺;?_Javascript_Reactjs_Redux - Fatal编程技术网

Javascript 如何用“解决问题”;找不到店铺;?

Javascript 如何用“解决问题”;找不到店铺;?,javascript,reactjs,redux,Javascript,Reactjs,Redux,我的商店有问题。当我在Chrome中打开开发工具时,我遇到了这样一个问题:“找不到存储区。请确保按照我使用的说明进行操作。”。这是我的密码: ./configureStore/index.js import {createStore, applyMiddleware, compose} from 'redux'; import rootReducer from '../reducers/index'; import thunkMiddleware from 'redux-thunk'; co

我的商店有问题。当我在Chrome中打开开发工具时,我遇到了这样一个问题:“找不到存储区。请确保按照我使用的说明进行操作。”。这是我的密码:

./configureStore/index.js

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


const initialState = {
  photos: []
}

export default function configureStore() {

  const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

  const enhancers = composeEnhancers(applyMiddleware(thunkMiddleware));

  const store = createStore(rootReducer,initialState,enhancers);

  return store
}

和./containers/Root.js

import React, {Component} from 'react';
import configureStore from '../configureStore/index.js';
import AsyncApp from './AsyncApp.js'
import {Provider} from 'react-redux';
import { render } from 'react-dom';

const store = configureStore();

export default class Root extends Component {
  render() {
    return (
      <Provider store={store}>
        <AsyncApp />
      </Provider>
    )
  }
}



你能把减速机代码也发出来吗?chrome提供了哪些说明?这只会发生在chrome上?你能从组件访问状态吗?@CelsoWellington-这是指令。我只为Chrome做我的项目,所以我试着只在Chrome中运行它。我在帖子里加的减速机。谢谢你的帮助!你能把减速机代码也发出来吗?chrome提供了哪些说明?这只会发生在chrome上?你能从组件访问状态吗?@CelsoWellington-这是指令。我只为Chrome做我的项目,所以我试着只在Chrome中运行它。我在帖子里加的减速机。谢谢你的帮助!
import 'babel-polyfill'

import React from 'react'
import { render } from 'react-dom'
import Root from './containers/Root.js'

render(<Root />, document.querySelector('.fixed-container'));

import { combineReducers } from 'redux';
import {
  UPLOAD_PHOTOS_REQUEST,
  UPLOAD_PHOTOS_SUCCES,
  UPLOAD_PHOTOS_FAIL
} from '../actions/index.js'

const initialState = {
  isFetching: false,
  error: false,
  photos: []
}

function photos(state = initialState, action) {
  switch (action.type) {
    case UPLOAD_PHOTOS_REQUEST:
      return Object.assign({}, state, {
        isFetching: true,
        error: false
      })

    case UPLOAD_PHOTOS_SUCCES:
      return Object.assign({}, state, {
        isFetching: false,
        error: false,
        payload: action.payload,
        recievedAt: action.receivedAt
      })

    case UPLOAD_PHOTOS_FAIL:
      return Object.assign({}, state, {
        isFetching: false,
        error: true,
        payload: action.payload,
      })

    default:
      return {
        ...state,
        photos: state.photos
      }
  }
}

const rootReducer = combineReducers({
  photos
})

export default rootReducer;