小编mys*_*iar的帖子

react-router-redux:无法在syncHistoryWithStore读取未定义的属性'listen'

我正在将Redact Ract应用程序重构为Redux.我已经确定了一些测试的动作和减速器.我在路由器和历史上得到了堆栈.
我收到错误:

未捕获的TypeError:无法在syncHistoryWithStore读取未定义的属性'listen'

从简单的代码:

//configureStore.jsx
import redux from 'redux';
import {buildingReducer, levelReducer, roomReducer} from 'reducers';
import {routerReducer} from 'react-router-redux';

export let configure = (initialState = {}) => {
    let reducer = redux.combineReducers({
        building: buildingReducer,
        level: levelReducer,
        room: roomReducer,
        routing: routerReducer
   });

   let store = redux.createStore(reducer, initialState, redux.compose(
    window.devToolsExtension ? window.devToolsExtension() : f => f));

   return store;

};
Run Code Online (Sandbox Code Playgroud)

&

//app.jsx
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, browserHistory, hashHistory } from 'react-router';
import {Provider} …
Run Code Online (Sandbox Code Playgroud)

react-router-redux

7
推荐指数
2
解决办法
7307
查看次数

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

Symfony 4.4 翻译接口问题

最近将应用程序从 Symfony 4.3 升级到 4.4,并且在生产中我遇到了 Symfony Translator 界面的问题

配置:

framework:
default_locale: pl
translator:
    default_path: '%kernel.project_dir%/translations'
Run Code Online (Sandbox Code Playgroud)

错误:

Fatal error: Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale) must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale) in ./vendor/symfony/translation/TranslatorInterface.php on line 24
Fatal error: Declaration of Symfony\Component\Translation\Translator::trans($id, array $parameters = Array, $domain = NULL, $locale = NULL) must be compatible with Symfony\Contracts\Translation\TranslatorInterface::trans(string $id, array $parameters = Array, ?string $domain = NULL, ?string $locale = NULL) in ./vendor/symfony/translation/Translator.php on line 32
Run Code Online (Sandbox Code Playgroud)

translation interface symfony

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