Skip to content

codetodamoon/react-router-with-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-router-with-query

  • 把query string解析为对象,注入到props上,方便访问

使用方式

1.安装

yarn add react-router-with-query

2.引入

import withQuery from 'react-router-with-query'

...

export default withQuery(Component)

3.访问属性


const { query } =  this.props

console.log(query.a) // a = 1, www.baidu.com?a=1

About

Parse query string to object and inject to component props

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors