Skip to content

Sync with react.dev @ e07ac94b #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
[compiler] Fix misleading code example (#7889)
When the compiler bails out on code, it  leaves it untouched and unoptimized, so it's always safe for the compiler to bailout.

`panicThreshold` in most cases should be kept as `'none'` unless you want to fail the build on these safe bailouts. It's really only useful during dev when you're working on increasing the coverage of the compiler on your codebase.

I think having it shown here is confusing so I'm opting to just remove it for this particular code example.
  • Loading branch information
poteto authored Jul 21, 2025
commit d7160a896bce75dddd602dc28c13a4abdfecde2c
5 changes: 2 additions & 3 deletions src/content/learn/react-compiler/incremental-adoption.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,15 @@ module.exports = {
test: './src/experimental/**/*.{js,jsx,ts,tsx}',
plugins: [
['babel-plugin-react-compiler', {
compilationMode: 'annotation', // Only compile "use memo" components
panicThreshold: 'none' // More permissive for experimental code
// options ...
}]
]
},
{
test: './src/production/**/*.{js,jsx,ts,tsx}',
plugins: [
['babel-plugin-react-compiler', {
panicThreshold: 'critical_errors' // Stricter for production code
// options ...
}]
]
}
Expand Down