加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

react-router服务器渲染match方法之renderProps内部结构

发布时间:2020-12-15 07:20:55 所属栏目:百科 来源:网络整理
导读:最新内容请在github阅读,我会定时更新这部分的内容。给您带来不便,请见谅~~~~ 下面是react-router的match方法中的renderProps属性的内部签名: 其中renderProps包含routes,params,location,components,router,matchContext属性。 { //renderProps包含route

最新内容请在github阅读,我会定时更新这部分的内容。给您带来不便,请见谅~~~~
下面是react-router的match方法中的renderProps属性的内部签名:
其中renderProps包含routes,params,location,components,router,matchContext属性。

{ 
    //renderProps包含routes对象
    routes:
    [ { path: '/',component: [Function: App],IndexRoute: [Object],childRoutes: [Object]
     },{ component: [Function: Home],path: 'home' } 
    ],//renderProps包含params对象
   params: {},// renderProps包含location对象
   location:
    { pathname: '/home',search: '',hash: '',state: undefined,action: 'POP',key: '34hg49',query: {}
     },// renderProps包含components对象
   components: [ [Function: App],[Function: Home] ],// renderProps包含router对象
   router:
    { getCurrentLocation: [Function: getCurrentLocation],listenBefore: [Function: listenBefore],listen: [Function: listen],transitionTo: [Function: transitionTo],push: [Function: push],replace: [Function: replace],go: [Function: go],goBack: [Function: goBack],goForward: [Function: goForward],createKey: [Function: createKey],createPath: [Function: createPath],createHref: [Function: createHref],createLocation: [Function: createLocation],canGo: [Function: canGo],unsubscribe: [Function: unsubscribe],setRouteLeaveHook: [Function: listenBeforeLeavingRoute],isActive: [Function: isActive],location:
       { pathname: '/home',query: {} 
     },params: {},routes: [ [Object],[Object] ] 
      },// renderProps包含matchContext对象
   matchContext:
    { transitionManager:
       { isActive: [Function: isActive],match: [Function: match],listenBeforeLeavingRoute: [Function: listenBeforeLeavingRoute],listen: [Function: listen] },router:
       { getCurrentLocation: [Function: getCurrentLocation],location: [Object],routes: [Object] 
     }
   } 
 }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读