Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strict Mode 会出错 #752

Closed
xiaoxiangmoe opened this issue Aug 1, 2018 · 2 comments
Closed

Strict Mode 会出错 #752

xiaoxiangmoe opened this issue Aug 1, 2018 · 2 comments

Comments

@xiaoxiangmoe
Copy link
Contributor

文件如下:

//   src/pages/index.js
export default ()=>'马猴烧酒'
//  src/layouts/index.js

import * as React from 'react';
export default (props)=>
<React.StrictMode>
    {props.children}
</React.StrictMode>

会出错

Warning: Unsafe lifecycle methods were found within a strict-mode tree:
    in Unknown (created by Route)
    in Route (created by Route)
    in Switch (created by Route)
    in Route
    in Router
    in Unknown

componentWillMount: Please update the following components to use componentDidMount instead: Route, Switch

componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Route, Switch

Learn more about this warning here:
https://fb.me/react-strict-mode-warnings
@fi3ework
Copy link
Contributor

fi3ework commented Sep 9, 2018

这是 react 的提示啊,跟 umi 没什么关系吧

@sorrycc
Copy link
Member

sorrycc commented Sep 17, 2018

这是 react-router 的问题,remix-run/react-router#6060

@sorrycc sorrycc closed this as completed Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants