stunstunstun/wiki

Rethinking hooks memoization

stunstunstun opened this issue · 0 comments

Overview

import * as React from 'react';
import { Global, css } from '@emotion/react';

const NotoSansKR: React.FC = () => {
  return (
    <Global styles={css`
      @import url('https://fonts.googleapis.com/css?family=Noto+Sans+KR:400,700&display=swap&subset=korean');
    `} />
  );
};

const always = () => true;
export default React.memo(NotoSansKR, always);

https://github.com/devsisters/web-packages/blob/master/packages/gatsby-theme-emotion-webfonts/src/components/ko/NotoSansKR/index.tsx

References