xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

React & Strict Mode

React & Strict Mode

https://reactjs.org/docs/strict-mode.html#detecting-unexpected-side-effects

render twice bug

import React from 'react';

function ExampleApplication() {
  return (
    <div>
      <Header />
      <React.StrictMode>
        <div>
          <ComponentOne />
          <ComponentTwo />
        </div>
      </React.StrictMode>
      <Footer />
    </div>
  );
}

refs

https://stackoverflow.com/questions/53183362/what-is-strictmode-in-react

react best practices

https://kentcdodds.com/blog/react-strict-mode/

https://flaviocopes.com/react-strictmode/

https://www.reddit.com/r/reactjs/comments/dm2d4y/wait_youre_not_using_strictmode/


©xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


posted @ 2020-06-03 12:22  xgqfrms  阅读(303)  评论(2编辑  收藏  举报