react-router路由hashHistory传值

1. 引入包

import {hashHistory} from 'react-router'

2. 跳转传值

参数放在query对象里面

Search = () => {
	hashHistory.push({
		pathname: '/borrow/searchPage',
		query: {category: this.state.category},
	});
}

使用

 console.log(this.props.location.query.category)
发布了39 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/YYYYYun/article/details/95078759