File tree Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Expand file tree Collapse file tree 4 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,14 @@ const nextConfig = {
3636 // Don't bundle the shim unnecessarily.
3737 config . resolve . alias [ 'use-sync-external-store/shim' ] = 'react' ;
3838
39+ // ESLint depends on the CommonJS version of esquery,
40+ // but Webpack loads the ESM version by default. This
41+ // alias ensures the correct version is used.
42+ //
43+ // More info:
44+ // https://github.com/reactjs/react.dev/pull/8115
45+ config . resolve . alias [ 'esquery' ] = 'esquery/dist/esquery.min.js' ;
46+
3947 const { IgnorePlugin, NormalModuleReplacementPlugin} = require ( 'webpack' ) ;
4048 config . plugins . push (
4149 new NormalModuleReplacementPlugin (
Original file line number Diff line number Diff line change @@ -21,13 +21,6 @@ const getCodeMirrorPosition = (
2121
2222const linter = new Linter ( ) ;
2323
24- // HACK! Eslint requires 'esquery' using `require`, but there's no commonjs interop.
25- // because of this it tries to run `esquery.parse()`, while there's only `esquery.default.parse()`.
26- // This hack places the functions in the right place.
27- const esquery = require ( 'esquery' ) ;
28- esquery . parse = esquery . default ?. parse ;
29- esquery . matches = esquery . default ?. matches ;
30-
3124const reactRules = require ( 'eslint-plugin-react-hooks' ) . rules ;
3225linter . defineRules ( {
3326 'react-hooks/rules-of-hooks' : reactRules [ 'rules-of-hooks' ] ,
Original file line number Diff line number Diff line change @@ -1271,6 +1271,16 @@ button { margin-left: 10px; }
12711271
12721272デフォルトでは、アプリケーションがレンダー中にエラーをスローすると、React はその UI を画面から削除します。これを防ぐために、UI を* エラーバウンダリ* にラップすることができます。エラーバウンダリは、クラッシュした部位の代わりに、例えばエラーメッセージなどのフォールバック UI を表示するための、特別なコンポーネントです。
12731273
1274+ < Note>
1275+ 以下の場合、エラーバウンダリはエラーをキャッチしません。
1276+
1277+ - イベントハンドラ[(詳細)](/ learn/ responding- to- events)
1278+ - [サーバサイドレンダリング](/ reference/ react- dom/ server)
1279+ - エラーバウンダリ自身(子ではなく)でスローされたエラー
1280+ - 非同期コード(例えば ` setTimeout` や ` requestAnimationFrame` のコールバック)。ただし [` useTransition` ](/ reference/ react/ useTransition) フックが返す [` startTransition` ](/ reference/ react/ useTransition#starttransition) 関数の使用は例外です。トランジション関数内でスローされたエラーはエラーバウンダリでキャッチされます[(詳細)](/ reference/ react/ useTransition#displaying- an- error- to- users- with - error- boundary)。
1281+
1282+ < / Note>
1283+
12741284エラーバウンダリコンポーネントを実装するためには、エラーに反応して state を更新し、ユーザにエラーメッセージを表示するための [` static getDerivedStateFromError` ](#static - getderivedstatefromerror) を提供する必要があります。またオプションで、例えばエラーを分析サービスに記録するなどの追加のロジックを追加するために [` componentDidCatch` ](#componentdidcatch) を実装することもできます。
12751285
12761286[` captureOwnerStack` ](/ reference/ react/ captureOwnerStack) を使うことで開発中にオーナーのスタックトレースを含めることが可能です。
Original file line number Diff line number Diff line change 3232 "date" : " October 7, 2025" ,
3333 "path" : " /blog/2025/10/07/introducing-the-react-foundation"
3434 },
35+ {
36+ "title" : " React 19.2" ,
37+ "titleForHomepage" : " React 19.2" ,
38+ "icon" : " blog" ,
39+ "date" : " October 1, 2025" ,
40+ "path" : " /blog/2025/10/01/react-19-2"
41+ },
3542 {
3643 "title" : " React Labs: ビュー遷移、Activity、その他もろもろ" ,
3744 "titleForHomepage" : " ビュー遷移と Activity" ,
You can’t perform that action at this time.
0 commit comments