Skip to content

location.query字段缺失 #72

@stoneyallen

Description

@stoneyallen

umi中的location在react-rounter基础上增加了query属性

umi在react-router中加入了query这个属性,但是umi-server环境获取不到这个query,导致报错

组件代码

`
const Verify: React.FC<IProps & RouteComponentProps> = ({ location }) => {

const { token } = location.query;
......
)};
`

原页面中获取到的object截图

image

使用ssr、prerender配置后,页面报错

(node:25263) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'token' of undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions