💡
ReactのuseContextは時代遅れ?
useContextに関する記事を漁っていたら、radditでuseContextはすでに時代遅れなHooksであると話題になっていました。
どうやら、話題の元となったのは、React.jsの開発チームメンバーがXでツイートしていたことからだそうです。引用元@tweet
By the end of 2024, you’ll likely never need these APIs again:
• useMemo, useCallback, memo → React Compiler
• forwardRef → ref is a prop
• React.lazy → RSC, promise-as-child
• useContext → use(Context)
• throw promise → use(promise)
• <Context.Provider> → <Context>
今までcontextを扱うのにはuseContextを使っていましたが、useはHooksではなくReactのAPIのようです。Reactは1年もすれば技術もどんどん変わってくるので、キャッチアップが必要ですね。
Discussion