小编Fai*_*lik的帖子

哈希路由导航不起作用 - React router redux

我是 React js 的新手,我正在为我的项目使用哈希路由,我有一个登录页面和仪表板。当我单击登录按钮时,我应该重定向到仪表板。

目前,当我单击登录按钮时,网址从“ http://localhost:8080/#/login ”更改为http://localhost:8080/#/dashboard - 但页面未呈现..:(

这是我用来推送的代码 - store.dispatch(push('#/dashboard'));

使用此链接进行配置 - https://github.com/ReactTraining/react-router/tree/master/packages/react-router-redux

const history = createHistory();
const middleware = routerMiddleware(history);  
const sagaMiddleware = createSagaMiddleware();    //saga


export const store = createStore(combineReducers({ login: L_reducer, router: routerReducer }),applyMiddleware(sagaMiddleware,middleware));
//no error

sagaMiddleware.run(watcherSaga);

ReactDOM.render((
  <Provider store={store}>
  <ConnectedRouter history={history}>
  <HashRouter>
    <Switch>
      <Route exact path="/login" name="Login Page" component={Login}/>
      <Route exact path="/register" name="Register Page" component={Register}/>
      <Route path="/" name="Home" component={Full}/>
    </Switch>
  </HashRouter>
  </ConnectedRouter>
  </Provider>

), document.getElementById('root'));
Run Code Online (Sandbox Code Playgroud)

reactjs react-router

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

将两个数字相除并快速返回分数

我知道这是一个简单的问题,但我想得到这样的结果。

3/6 = 0.500000

将两个数字相除并在单个变量中返回商和提醒,我如何快速实现上述目标?

math division ios swift

-3
推荐指数
1
解决办法
1830
查看次数

标签 统计

division ×1

ios ×1

math ×1

react-router ×1

reactjs ×1

swift ×1