umi中的location在react-rounter基础上增加了query属性
umi在react-router中加入了query这个属性,但是umi-server环境获取不到这个query,导致报错
组件代码
`
const Verify: React.FC<IProps & RouteComponentProps> = ({ location }) => {
const { token } = location.query;
......
)};
`
原页面中获取到的object截图

使用ssr、prerender配置后,页面报错
(node:25263) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'token' of undefined
umi中的location在react-rounter基础上增加了query属性
umi在react-router中加入了query这个属性,但是umi-server环境获取不到这个query,导致报错
组件代码
`
const Verify: React.FC<IProps & RouteComponentProps> = ({ location }) => {
const { token } = location.query;
......
)};
`
原页面中获取到的object截图
使用ssr、prerender配置后,页面报错
(node:25263) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'token' of undefined