Augment react-router module with react-router-relay typings

前端 未结 2 950
礼貌的吻别
礼貌的吻别 2021-02-19 02:40

The default react-router is used as such:

import * as React from \'react\';
import { Router, Route, hashHistory } from \'react-router\';

const routing = (
    &         


        
相关标签:
2条回答
  • 2021-02-19 03:04

    Try this one

    declare module 'react-router' { 
       interface RouterProps {
          environment?: any
          render?: any
       } 
    }
    

    it's working with the latest react-router definitions.

    0 讨论(0)
  • 2021-02-19 03:27
    <Router history={hashHistory} render={applyRouterMiddleware(useRelay)} environment={Relay.Store}>
        <Route path="/login" component={Login}/>
    </Router>   
    

    Looks like login (component={Login}) is not Imported.Hence, It always return an error.

    0 讨论(0)
提交回复
热议问题