最終更新:2022-07-08 (金) 17:35:02 (657d)
React/import
import React from 'react';
- export defaultしているモノのみimportする
- 非推奨?
- https://reactjs.org/docs/react-api.html
- ここでは使ってる
import * as React from 'react';
- ビルドファイルが肥大化する
- This is the correct way to import React from an ES module since the ES module will not have a default export. Only named exports.
- 使うものだけ*の代わりに{useRef}とか書くのが良い