Eras Tour Tickets
@@ -2006,7 +2006,7 @@ export default function Item({action}) {
startTransition(() => {
action(e.target.value);
});
- }
+ }
return (
Eras Tour Tickets
diff --git a/src/content/reference/rules/components-and-hooks-must-be-pure.md b/src/content/reference/rules/components-and-hooks-must-be-pure.md
index 6da6d49bb..2937dc210 100644
--- a/src/content/reference/rules/components-and-hooks-must-be-pure.md
+++ b/src/content/reference/rules/components-and-hooks-must-be-pure.md
@@ -209,7 +209,7 @@ You can think of the props and state values as snapshots that are updated after
### Don't mutate Props {/*props*/}
Props are immutable because if you mutate them, the application will produce inconsistent output, which can be hard to debug as it may or may not work depending on the circumstances.
-```js {2}
+```js {expectedErrors: {'react-compiler': [2]}} {2}
function Post({ item }) {
item.url = new Url(item.url, base); // 🔴 Bad: never mutate props directly
return {item.title};
@@ -232,7 +232,7 @@ const [stateVariable, setter] = useState(0);
Rather than updating the state variable in-place, we need to update it using the setter function that is returned by `useState`. Changing values on the state variable doesn't cause the component to update, leaving your users with an outdated UI. Using the setter function informs React that the state has changed, and that we need to queue a re-render to update the UI.
-```js {5}
+```js {expectedErrors: {'react-compiler': [2, 5]}} {5}
function Counter() {
const [count, setCount] = useState(0);
@@ -270,7 +270,7 @@ function Counter() {
Once values are passed to a hook, you should not modify them. Like props in JSX, values become immutable when passed to a hook.
-```js {4}
+```js {expectedErrors: {'react-compiler': [4]}} {4}
function useIconStyle(icon) {
const theme = useContext(ThemeContext);
if (icon.enabled) {
@@ -331,7 +331,7 @@ Don't mutate values after they've been used in JSX. Move the mutation to before
When you use JSX in an expression, React may eagerly evaluate the JSX before the component finishes rendering. This means that mutating values after they've been passed to JSX can lead to outdated UIs, as React won't know to update the component's output.
-```js {4}
+```js {expectedErrors: {'react-compiler': [4]}} {4}
function Page({ colour }) {
const styles = { colour, size: "large" };
const header = ;
diff --git a/src/content/reference/rules/react-calls-components-and-hooks.md b/src/content/reference/rules/react-calls-components-and-hooks.md
index 3d865b4f2..03354ad5a 100644
--- a/src/content/reference/rules/react-calls-components-and-hooks.md
+++ b/src/content/reference/rules/react-calls-components-and-hooks.md
@@ -21,7 +21,7 @@ function BlogPost() {
}
```
-```js {2}
+```js {expectedErrors: {'react-compiler': [2]}} {2}
function BlogPost() {
return {Article()}; // 🔴 Bad: Never call them directly
}
@@ -51,7 +51,7 @@ Breaking this rule will cause React to not automatically optimize your component
Hooks should be as "static" as possible. This means you shouldn't dynamically mutate them. For example, this means you shouldn't write higher order Hooks:
-```js {2}
+```js {expectedErrors: {'react-compiler': [2, 3]}} {2}
function ChatInput() {
const useDataWithLogging = withLogging(useData); // 🔴 Bad: don't write higher order Hooks
const data = useDataWithLogging();
@@ -74,7 +74,7 @@ function useDataWithLogging() {
Hooks should also not be dynamically used: for example, instead of doing dependency injection in a component by passing a Hook as a value:
-```js {2}
+```js {expectedErrors: {'react-compiler': [2]}} {2}
function ChatInput() {
return // 🔴 Bad: don't pass Hooks as props
}
diff --git a/src/hooks/usePendingRoute.ts b/src/hooks/usePendingRoute.ts
index 229a36e64..17d7525b4 100644
--- a/src/hooks/usePendingRoute.ts
+++ b/src/hooks/usePendingRoute.ts
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/pages/404.js b/src/pages/404.js
index 2a88fc29a..2b5a83baf 100644
--- a/src/pages/404.js
+++ b/src/pages/404.js
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/pages/500.js b/src/pages/500.js
index b043e35b2..552dcf77b 100644
--- a/src/pages/500.js
+++ b/src/pages/500.js
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/pages/[[...markdownPath]].js b/src/pages/[[...markdownPath]].js
index bef4508df..cb2e23a38 100644
--- a/src/pages/[[...markdownPath]].js
+++ b/src/pages/[[...markdownPath]].js
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx
index 5431f87cc..80a0a0f86 100644
--- a/src/pages/_app.tsx
+++ b/src/pages/_app.tsx
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx
index 6849df35d..21b6f4d4f 100644
--- a/src/pages/_document.tsx
+++ b/src/pages/_document.tsx
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/pages/errors/[errorCode].tsx b/src/pages/errors/[errorCode].tsx
index c8cf28ad8..67466a1d9 100644
--- a/src/pages/errors/[errorCode].tsx
+++ b/src/pages/errors/[errorCode].tsx
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
import {Fragment, useMemo} from 'react';
import {Page} from 'components/Layout/Page';
import {MDXComponents} from 'components/MDX/MDXComponents';
diff --git a/src/pages/errors/index.tsx b/src/pages/errors/index.tsx
index d7742f03a..0c154039c 100644
--- a/src/pages/errors/index.tsx
+++ b/src/pages/errors/index.tsx
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
import ErrorDecoderPage from './[errorCode]';
export default ErrorDecoderPage;
export {getStaticProps} from './[errorCode]';
diff --git a/src/sidebarReference.json b/src/sidebarReference.json
index 8bc94a4e9..7d43c730e 100644
--- a/src/sidebarReference.json
+++ b/src/sidebarReference.json
@@ -390,6 +390,84 @@
"title": "Compiling Libraries",
"path": "/reference/react-compiler/compiling-libraries"
},
+ {
+ "hasSectionHeader": true,
+ "sectionHeader": "eslint-plugin-react-hooks"
+ },
+ {
+ "title": "Lints",
+ "path": "/reference/eslint-plugin-react-hooks",
+ "routes": [
+ {
+ "title": "component-hook-factories",
+ "path": "/reference/eslint-plugin-react-hooks/lints/component-hook-factories"
+ },
+ {
+ "title": "config",
+ "path": "/reference/eslint-plugin-react-hooks/lints/config"
+ },
+ {
+ "title": "error-boundaries",
+ "path": "/reference/eslint-plugin-react-hooks/lints/error-boundaries"
+ },
+ {
+ "title": "exhaustive-deps",
+ "path": "/reference/eslint-plugin-react-hooks/lints/exhaustive-deps"
+ },
+ {
+ "title": "gating",
+ "path": "/reference/eslint-plugin-react-hooks/lints/gating"
+ },
+ {
+ "title": "globals",
+ "path": "/reference/eslint-plugin-react-hooks/lints/globals"
+ },
+ {
+ "title": "immutability",
+ "path": "/reference/eslint-plugin-react-hooks/lints/immutability"
+ },
+ {
+ "title": "incompatible-library",
+ "path": "/reference/eslint-plugin-react-hooks/lints/incompatible-library"
+ },
+ {
+ "title": "preserve-manual-memoization",
+ "path": "/reference/eslint-plugin-react-hooks/lints/preserve-manual-memoization"
+ },
+ {
+ "title": "purity",
+ "path": "/reference/eslint-plugin-react-hooks/lints/purity"
+ },
+ {
+ "title": "refs",
+ "path": "/reference/eslint-plugin-react-hooks/lints/refs"
+ },
+ {
+ "title": "rules-of-hooks",
+ "path": "/reference/eslint-plugin-react-hooks/lints/rules-of-hooks"
+ },
+ {
+ "title": "set-state-in-effect",
+ "path": "/reference/eslint-plugin-react-hooks/lints/set-state-in-effect"
+ },
+ {
+ "title": "set-state-in-render",
+ "path": "/reference/eslint-plugin-react-hooks/lints/set-state-in-render"
+ },
+ {
+ "title": "static-components",
+ "path": "/reference/eslint-plugin-react-hooks/lints/static-components"
+ },
+ {
+ "title": "unsupported-syntax",
+ "path": "/reference/eslint-plugin-react-hooks/lints/unsupported-syntax"
+ },
+ {
+ "title": "use-memo",
+ "path": "/reference/eslint-plugin-react-hooks/lints/use-memo"
+ }
+ ]
+ },
{
"hasSectionHeader": true,
"sectionHeader": "Rules of React"
diff --git a/src/siteConfig.js b/src/siteConfig.js
index e731dcec4..a43fbf5fc 100644
--- a/src/siteConfig.js
+++ b/src/siteConfig.js
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/types/docsearch-react-modal.d.ts b/src/types/docsearch-react-modal.d.ts
index 568ffed80..f169f0364 100644
--- a/src/types/docsearch-react-modal.d.ts
+++ b/src/types/docsearch-react-modal.d.ts
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/utils/analytics.ts b/src/utils/analytics.ts
index c2cc623b9..bd5b5f600 100644
--- a/src/utils/analytics.ts
+++ b/src/utils/analytics.ts
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/utils/compileMDX.ts b/src/utils/compileMDX.ts
index be770c29a..807b50da5 100644
--- a/src/utils/compileMDX.ts
+++ b/src/utils/compileMDX.ts
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
import {LanguageItem} from 'components/MDX/LanguagesContext';
import {MDXComponents} from 'components/MDX/MDXComponents';
diff --git a/src/utils/finishedTranslations.ts b/src/utils/finishedTranslations.ts
index 6f509f0b5..1bd55637a 100644
--- a/src/utils/finishedTranslations.ts
+++ b/src/utils/finishedTranslations.ts
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
// This is a list of languages with enough translated content.
// Add more languages here when they have enough content.
// Please DO NOT edit this list without a discussion in the reactjs/react.dev repo.
diff --git a/src/utils/forwardRefWithAs.tsx b/src/utils/forwardRefWithAs.tsx
index 8f8282ab1..c5975c199 100644
--- a/src/utils/forwardRefWithAs.tsx
+++ b/src/utils/forwardRefWithAs.tsx
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/utils/prepareMDX.js b/src/utils/prepareMDX.js
index 20a22577d..5ad0a64b0 100644
--- a/src/utils/prepareMDX.js
+++ b/src/utils/prepareMDX.js
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/utils/processShim.js b/src/utils/processShim.js
index 7d8454988..915a9ea33 100644
--- a/src/utils/processShim.js
+++ b/src/utils/processShim.js
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/utils/rafShim.js b/src/utils/rafShim.js
index 9c3097d8f..f4984da83 100644
--- a/src/utils/rafShim.js
+++ b/src/utils/rafShim.js
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/utils/rss.js b/src/utils/rss.js
index 29e5511ea..82764351c 100644
--- a/src/utils/rss.js
+++ b/src/utils/rss.js
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/src/utils/toCommaSeparatedList.tsx b/src/utils/toCommaSeparatedList.tsx
index e95ee1799..affa1970a 100644
--- a/src/utils/toCommaSeparatedList.tsx
+++ b/src/utils/toCommaSeparatedList.tsx
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/tailwind.config.js b/tailwind.config.js
index f31a24516..9450cfa59 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -1,3 +1,10 @@
+/**
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
diff --git a/yarn.lock b/yarn.lock
index e5eecaac2..b8480f1c5 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2273,12 +2273,12 @@ babel-plugin-dynamic-import-node@^2.3.3:
dependencies:
object.assign "^4.1.0"
-babel-plugin-react-compiler@19.0.0-beta-e552027-20250112:
- version "19.0.0-beta-e552027-20250112"
- resolved "https://registry.yarnpkg.com/babel-plugin-react-compiler/-/babel-plugin-react-compiler-19.0.0-beta-e552027-20250112.tgz#f06f0436420bd09df5abf37337ecd8fb43b0d847"
- integrity sha512-pUTT0mAZ4XLewC6bvqVeX015nVRLVultcSQlkzGdC10G6YV6K2h4E7cwGlLAuLKWTj3Z08mTO9uTnPP/opUBsg==
+babel-plugin-react-compiler@^19.1.0-rc.3:
+ version "19.1.0-rc.3"
+ resolved "https://registry.yarnpkg.com/babel-plugin-react-compiler/-/babel-plugin-react-compiler-19.1.0-rc.3.tgz#45e5a282a2460b3701971e5eb8310a90a7919022"
+ integrity sha512-mjRn69WuTz4adL0bXGx8Rsyk1086zFJeKmes6aK0xPuK3aaXmDJdLHqwKKMrpm6KAI1MCoUK72d2VeqQbu8YIA==
dependencies:
- "@babel/types" "^7.19.0"
+ "@babel/types" "^7.26.0"
bail@^1.0.0:
version "1.0.5"
@@ -3405,6 +3405,10 @@ eslint-plugin-jsx-a11y@^6.4.1:
safe-regex-test "^1.0.3"
string.prototype.includes "^2.0.0"
+"eslint-plugin-local-rules@link:eslint-local-rules":
+ version "0.0.0"
+ uid ""
+
eslint-plugin-react-compiler@^19.0.0-beta-e552027-20250112:
version "19.0.0-beta-e552027-20250112"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-compiler/-/eslint-plugin-react-compiler-19.0.0-beta-e552027-20250112.tgz#f4ad9cebe47615ebf6097a8084a30d761ee164f4"