Skip to content

React Note

Use local storage#

Using Hooks#

  • @2021-10-13
  • Calling useSelector, even for unused var, will cause a render.
  • Customized hook cannot pass status, unless other status hooks like useLocalStorage(), useContext() are called.
  • @2021-10-18
  • Using setState for a JSX.Element might cause a long execution time, hence cause a memory leak.

CRA dotenv#

CRA polyfill#

Full height page#

  • @2022-01-06
  • Add style={height: '100%'} to the root <div> in public/index.html.
  • Example on StackOverflow
  • search keywords: 100vh, 100% height,

ESlint overriding in CRA#