IE9 react-router-dom路由传参 location.state

#1

由于不清楚location.state的兼容性,IE9中使用this.props.history.push跳转路由,使用state保存参数,使用this.props.location.state取到undefined,打印出来也没有,目前版本antd3.5.4,react-router-dom4.2.2,react16.2.0.
开发环境会报一个没有引入polyfill的警告,发布环境没有警告,我是在src/index.js中第一行引入import ‘babel-polyfill’;不知道这么写对不对
如果IE9无法使用location.state传参,那应该用什么方法?

#2

用react-router2 试试,4不支持IE9

#3

我用的是this.props.location.pathname来获取的

#4

地址栏明文?还是你给加密了

#5

明文的,你用state来存放什么的

#6

参考:requestAnimationFrame warnings on tests since React 16
参考:JavaScript Environment Requirements

1 Like
#7

确实可以解决楼上的warn