├── .env.development ├── .prettierignore ├── public ├── robots.txt ├── .well-known │ └── atproto-did ├── favicon.ico ├── images │ ├── uwu.png │ ├── g_arrow.png │ ├── og-blog.png │ ├── og-home.png │ ├── og-learn.png │ ├── team │ │ ├── joe.jpg │ │ ├── josh.jpg │ │ ├── mike.jpg │ │ ├── seth.jpg │ │ ├── yuzhi.jpg │ │ ├── acdlite.jpg │ │ ├── gaearon.jpg │ │ ├── hendrik.jpg │ │ ├── jordan.jpg │ │ ├── lauren.jpg │ │ ├── lesiutin.jpg │ │ ├── pieter.jpg │ │ ├── eli-white.jpg │ │ ├── jack-pope.jpg │ │ ├── jasonbonta.jpg │ │ ├── sophiebits.jpg │ │ ├── matt-carroll.png │ │ ├── mofei-zhang.png │ │ ├── rickhanlonii.jpg │ │ ├── sebmarkbage.jpg │ │ └── sebsilbermann.jpg │ ├── og-unknown.png │ ├── meta-gradient.png │ ├── og-community.png │ ├── og-reference.png │ ├── home │ │ ├── videos │ │ │ ├── rn.jpg │ │ │ ├── rsc.jpg │ │ │ ├── hooks.jpg │ │ │ ├── rethinking.jpg │ │ │ └── documentary.webp │ │ ├── conf2019 │ │ │ ├── alex.jpg │ │ │ ├── jed.jpg │ │ │ ├── jenn.jpg │ │ │ ├── joe.jpg │ │ │ ├── lee.jpg │ │ │ ├── luca.jpg │ │ │ ├── maja.jpg │ │ │ ├── nat.jpg │ │ │ ├── tae.jpg │ │ │ ├── tom.jpg │ │ │ ├── ashley.jpg │ │ │ ├── becca.jpg │ │ │ ├── brian.jpg │ │ │ ├── frank.jpg │ │ │ ├── lizzie.jpg │ │ │ ├── sophie.jpg │ │ │ ├── tania.jpg │ │ │ ├── tejas.jpg │ │ │ ├── yuzhi.jpg │ │ │ ├── alexandra.jpg │ │ │ ├── brittany.jpg │ │ │ └── cameron.jpg │ │ ├── conf2021 │ │ │ ├── eric.jpg │ │ │ ├── juan.jpg │ │ │ ├── lyle.jpg │ │ │ ├── rick.jpg │ │ │ ├── tafu.jpg │ │ │ ├── xuan.jpg │ │ │ ├── andrew.jpg │ │ │ ├── brian.jpg │ │ │ ├── daishi.jpg │ │ │ ├── debbie.jpg │ │ │ ├── delba.jpg │ │ │ ├── diego.jpg │ │ │ ├── helen.jpg │ │ │ ├── lauren.jpg │ │ │ ├── linton.jpg │ │ │ ├── rachel.jpg │ │ │ ├── robert.jpg │ │ │ ├── roman.jpg │ │ │ ├── sarah.jpg │ │ │ ├── shruti.jpg │ │ │ ├── steven.jpg │ │ │ ├── aakansha.jpg │ │ │ ├── shaundai.jpg │ │ │ └── cover.svg │ │ └── community │ │ │ ├── react_conf_fun.webp │ │ │ ├── react_conf_nat.webp │ │ │ ├── react_conf_selfie.webp │ │ │ ├── react_india_sunil.webp │ │ │ ├── react_india_team.webp │ │ │ ├── react_conf_elizabet.webp │ │ │ ├── react_conf_hallway.webp │ │ │ ├── react_india_hallway.webp │ │ │ └── react_india_selfie.webp │ ├── meta-gradient-dark.png │ ├── tutorial │ │ ├── empty-board.png │ │ ├── o-replaces-x.gif │ │ ├── devtools-select.gif │ │ ├── x-filled-square.png │ │ ├── number-filled-board.png │ │ ├── tictac-adding-x-s.gif │ │ ├── codesandbox-devtools.png │ │ ├── nine-x-filled-squares.png │ │ ├── two-x-filled-squares.png │ │ ├── board-filled-with-ones.png │ │ ├── board-filled-with-value.png │ │ └── react-starter-code-codesandbox.png │ ├── docs │ │ ├── diagrams │ │ │ ├── prerender.png │ │ │ ├── prewarm.png │ │ │ ├── render_tree.png │ │ │ ├── prerender.dark.png │ │ │ ├── prewarm.dark.png │ │ │ ├── writing_jsx_js.png │ │ │ ├── render_tree.dark.png │ │ │ ├── writing_jsx_form.png │ │ │ ├── writing_jsx_html.png │ │ │ ├── 19_2_batching_after.png │ │ │ ├── generic_render_tree.png │ │ │ ├── sharing_data_child.png │ │ │ ├── sharing_data_parent.png │ │ │ ├── sharing_state_child.png │ │ │ ├── writing_jsx_js.dark.png │ │ │ ├── writing_jsx_sidebar.png │ │ │ ├── 19_2_batching_before.png │ │ │ ├── preserving_state_tree.png │ │ │ ├── sharing_state_parent.png │ │ │ ├── writing_jsx_form.dark.png │ │ │ ├── writing_jsx_html.dark.png │ │ │ ├── 19_2_batching_after.dark.png │ │ │ ├── conditional_render_tree.png │ │ │ ├── generic_dependency_tree.png │ │ │ ├── generic_render_tree.dark.png │ │ │ ├── module_dependency_tree.png │ │ │ ├── passing_data_context_far.png │ │ │ ├── responding_to_input_flow.png │ │ │ ├── sharing_data_child.dark.png │ │ │ ├── sharing_data_parent.dark.png │ │ │ ├── sharing_state_child.dark.png │ │ │ ├── use_client_render_tree.png │ │ │ ├── writing_jsx_sidebar.dark.png │ │ │ ├── 19_2_batching_before.dark.png │ │ │ ├── passing_data_context_close.png │ │ │ ├── passing_data_lifting_state.png │ │ │ ├── passing_data_prop_drilling.png │ │ │ ├── preserving_state_diff_pt1.png │ │ │ ├── preserving_state_diff_pt2.png │ │ │ ├── preserving_state_dom_tree.png │ │ │ ├── preserving_state_increment.png │ │ │ ├── preserving_state_tree.dark.png │ │ │ ├── sharing_data_child_clicked.png │ │ │ ├── sharing_state_parent.dark.png │ │ │ ├── conditional_render_tree.dark.png │ │ │ ├── generic_dependency_tree.dark.png │ │ │ ├── module_dependency_tree.dark.png │ │ │ ├── passing_data_context_far.dark.png │ │ │ ├── responding_to_input_flow.dark.png │ │ │ ├── sharing_data_parent_clicked.png │ │ │ ├── sharing_state_child_clicked.png │ │ │ ├── sharing_state_parent_clicked.png │ │ │ ├── use_client_module_dependency.png │ │ │ ├── use_client_render_tree.dark.png │ │ │ ├── passing_data_context_close.dark.png │ │ │ ├── passing_data_lifting_state.dark.png │ │ │ ├── passing_data_prop_drilling.dark.png │ │ │ ├── preserving_state_add_component.png │ │ │ ├── preserving_state_diff_pt1.dark.png │ │ │ ├── preserving_state_diff_pt2.dark.png │ │ │ ├── preserving_state_diff_same_pt1.png │ │ │ ├── preserving_state_diff_same_pt2.png │ │ │ ├── preserving_state_dom_tree.dark.png │ │ │ ├── preserving_state_increment.dark.png │ │ │ ├── preserving_state_same_component.png │ │ │ ├── sharing_data_child_clicked.dark.png │ │ │ ├── preserving_state_diff_position_p1.png │ │ │ ├── preserving_state_diff_position_p2.png │ │ │ ├── preserving_state_diff_position_p3.png │ │ │ ├── preserving_state_remove_component.png │ │ │ ├── sharing_data_parent_clicked.dark.png │ │ │ ├── sharing_state_child_clicked.dark.png │ │ │ ├── sharing_state_parent_clicked.dark.png │ │ │ ├── use_client_module_dependency.dark.png │ │ │ ├── preserving_state_add_component.dark.png │ │ │ ├── preserving_state_diff_same_pt1.dark.png │ │ │ ├── preserving_state_diff_same_pt2.dark.png │ │ │ ├── preserving_state_same_component.dark.png │ │ │ ├── preserving_state_diff_position_p1.dark.png │ │ │ ├── preserving_state_diff_position_p2.dark.png │ │ │ ├── preserving_state_diff_position_p3.dark.png │ │ │ └── preserving_state_remove_component.dark.png │ │ ├── illustrations │ │ │ ├── i_ref.png │ │ │ ├── i_inputs1.png │ │ │ ├── i_inputs2.png │ │ │ ├── i_render1.png │ │ │ ├── i_render2.png │ │ │ ├── i_render3.png │ │ │ ├── i_rerender1.png │ │ │ ├── i_rerender2.png │ │ │ ├── i_rerender3.png │ │ │ ├── i_browser-paint.png │ │ │ ├── i_children-prop.png │ │ │ ├── i_puritea-recipe.png │ │ │ ├── i_react-batching.png │ │ │ ├── i_state-snapshot1.png │ │ │ ├── i_state-snapshot2.png │ │ │ ├── i_state-snapshot3.png │ │ │ ├── i_render-and-commit1.png │ │ │ ├── i_render-and-commit2.png │ │ │ ├── i_render-and-commit3.png │ │ │ ├── i_declarative-ui-programming.png │ │ │ └── i_imperative-ui-programming.png │ │ ├── s_thinking-in-react_ui.png │ │ ├── react-devtools-extension.png │ │ ├── react-devtools-standalone.png │ │ ├── performance-tracks │ │ │ ├── overview.png │ │ │ ├── scheduler.png │ │ │ ├── changed-props.png │ │ │ ├── overview.dark.png │ │ │ ├── scheduler.dark.png │ │ │ ├── scheduler-update.png │ │ │ ├── server-overview.png │ │ │ ├── changed-props.dark.png │ │ │ ├── components-effects.png │ │ │ ├── components-render.png │ │ │ ├── scheduler-update.dark.png │ │ │ ├── server-overview.dark.png │ │ │ ├── components-effects.dark.png │ │ │ ├── components-render.dark.png │ │ │ ├── scheduler-cascading-update.png │ │ │ └── scheduler-cascading-update.dark.png │ │ ├── react-devtools-usedebugvalue.png │ │ └── s_thinking-in-react_ui_outline.png │ └── blog │ │ ├── react-labs-april-2025 │ │ ├── flip.gif │ │ ├── perf_tracks.png │ │ ├── perf_tracks.webp │ │ ├── perf_tracks_dark.png │ │ └── perf_tracks_dark.webp │ │ ├── introducing-react-dev │ │ ├── home-dark.png │ │ └── home-light.png │ │ └── react-foundation │ │ ├── react_foundation_logo.png │ │ ├── react_foundation_logo.webp │ │ ├── react_foundation_logo_dark.png │ │ ├── react_foundation_logo_dark.webp │ │ ├── react_foundation_member_logos.png │ │ ├── react_foundation_member_logos.webp │ │ ├── react_foundation_member_logos_dark.png │ │ └── react_foundation_member_logos_dark.webp ├── favicon_old.ico ├── favicon-16x16.png ├── favicon-32x32.png ├── mstile-150x150.png ├── apple-touch-icon.png ├── android-chrome-192x192.png ├── android-chrome-384x384.png ├── android-chrome-512x512.png ├── fonts │ ├── Source-Code-Pro-Bold.woff2 │ └── Source-Code-Pro-Regular.woff2 ├── browserconfig.xml ├── site.webmanifest ├── js │ ├── jsfiddle-integration-babel.js │ └── jsfiddle-integration.js └── html │ └── single-file-example.html ├── .env.production ├── .eslintignore ├── .husky └── pre-commit ├── src ├── content │ ├── index.md │ ├── warnings │ │ ├── special-props.md │ │ ├── invalid-aria-prop.md │ │ └── react-test-renderer.md │ ├── errors │ │ ├── generic.md │ │ ├── index.md │ │ └── 377.md │ ├── reference │ │ ├── rsc │ │ │ └── directives.md │ │ ├── react │ │ │ ├── components.md │ │ │ └── apis.md │ │ ├── react-dom │ │ │ ├── client │ │ │ │ └── index.md │ │ │ ├── hooks │ │ │ │ └── index.md │ │ │ ├── static │ │ │ │ └── index.md │ │ │ └── components │ │ │ │ └── progress.md │ │ ├── eslint-plugin-react-hooks │ │ │ └── lints │ │ │ │ └── gating.md │ │ └── react-compiler │ │ │ └── panicThreshold.md │ ├── learn │ │ ├── setup.md │ │ └── react-compiler │ │ │ └── index.md │ ├── community │ │ ├── translations.md │ │ └── index.md │ └── blog │ │ └── 2020 │ │ └── 12 │ │ └── 21 │ │ └── data-fetching-with-react-server-components.md ├── components │ ├── Layout │ │ ├── TopNav │ │ │ └── index.tsx │ │ ├── SidebarNav │ │ │ └── index.tsx │ │ └── Sidebar │ │ │ └── index.tsx │ ├── MDX │ │ ├── LanguagesContext.tsx │ │ ├── TocContext.tsx │ │ ├── Challenges │ │ │ └── index.tsx │ │ ├── Intro.tsx │ │ ├── Recap.tsx │ │ ├── DiagramGroup.tsx │ │ ├── Sandpack │ │ │ ├── ErrorMessage.tsx │ │ │ ├── ClearButton.tsx │ │ │ ├── ReloadButton.tsx │ │ │ ├── OpenInCodeSandboxButton.tsx │ │ │ ├── OpenInTypeScriptPlayground.tsx │ │ │ ├── Themes.tsx │ │ │ ├── template.ts │ │ │ └── useSandpackLint.tsx │ │ ├── MDXComponents.module.css │ │ ├── SimpleCallout.tsx │ │ ├── InlineCode.tsx │ │ ├── PackageImport.tsx │ │ ├── YouWillLearnCard.tsx │ │ ├── CodeBlock │ │ │ └── index.tsx │ │ ├── CodeDiagram.tsx │ │ ├── Diagram.tsx │ │ └── Link.tsx │ ├── ExternalLink.tsx │ ├── Icon │ │ ├── IconError.tsx │ │ ├── IconClose.tsx │ │ ├── IconRss.tsx │ │ ├── IconTwitter.tsx │ │ ├── IconLink.tsx │ │ ├── IconCodeBlock.tsx │ │ ├── IconHamburger.tsx │ │ ├── IconSearch.tsx │ │ ├── IconFacebookCircle.tsx │ │ ├── IconGitHub.tsx │ │ ├── IconBsky.tsx │ │ ├── IconTerminal.tsx │ │ ├── IconArrow.tsx │ │ ├── IconSolution.tsx │ │ ├── IconWarning.tsx │ │ ├── IconNote.tsx │ │ ├── IconArrowSmall.tsx │ │ ├── IconDeepDive.tsx │ │ ├── IconHint.tsx │ │ ├── IconChevron.tsx │ │ ├── IconDownload.tsx │ │ └── IconPitfall.tsx │ ├── Logo.tsx │ ├── ErrorDecoderContext.tsx │ ├── Tag.tsx │ ├── Button.tsx │ ├── SocialBanner.tsx │ ├── ButtonLink.tsx │ └── Breadcrumbs.tsx ├── pages │ ├── errors │ │ └── index.tsx │ ├── 404.js │ └── 500.js ├── utils │ ├── rafShim.js │ ├── processShim.js │ ├── finishedTranslations.ts │ ├── analytics.ts │ └── toCommaSeparatedList.tsx ├── types │ └── docsearch-react-modal.d.ts ├── siteConfig.js ├── sidebarCommunity.json └── hooks │ └── usePendingRoute.ts ├── eslint-local-rules ├── __tests__ │ └── fixtures │ │ └── src │ │ └── content │ │ ├── mixed-language.md │ │ ├── stale-expected-error.md │ │ ├── basic-error.md │ │ ├── suppressed-error.md │ │ ├── malformed-metadata.md │ │ └── duplicate-metadata.md ├── parser.js ├── package.json └── index.js ├── next-env.d.ts ├── .github ├── dependabot.yml ├── PULL_REQUEST_TEMPLATE.md ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── 0-bug.yml │ ├── 1-typo.yml │ └── 2-suggestion.yml └── workflows │ ├── site_lint.yml │ ├── discord_notify.yml │ ├── label_core_team_prs.yml │ └── analyze_comment.yml ├── scripts ├── generateRss.js ├── headingIDHelpers │ ├── walk.js │ └── validateHeadingIDs.js └── headingIdLinter.js ├── .prettierrc ├── .gitignore ├── postcss.config.js ├── tsconfig.json ├── .eslintrc └── plugins └── markdownToHtml.js /.env.development: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | src/content/**/*.md 2 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /.env.production: -------------------------------------------------------------------------------- 1 | NEXT_PUBLIC_GA_TRACKING_ID = 'G-B1E83PJ3RT' -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | scripts 2 | plugins 3 | next.config.js 4 | -------------------------------------------------------------------------------- /public/.well-known/atproto-did: -------------------------------------------------------------------------------- 1 | did:plc:uorpbnp2q32vuvyeruwauyhe -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn lint-staged -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/images/uwu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/uwu.png -------------------------------------------------------------------------------- /public/favicon_old.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/favicon_old.ico -------------------------------------------------------------------------------- /public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/favicon-16x16.png -------------------------------------------------------------------------------- /public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/favicon-32x32.png -------------------------------------------------------------------------------- /public/images/g_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/g_arrow.png -------------------------------------------------------------------------------- /public/images/og-blog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/og-blog.png -------------------------------------------------------------------------------- /public/images/og-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/og-home.png -------------------------------------------------------------------------------- /public/images/og-learn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/og-learn.png -------------------------------------------------------------------------------- /public/images/team/joe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/joe.jpg -------------------------------------------------------------------------------- /public/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/mstile-150x150.png -------------------------------------------------------------------------------- /public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/apple-touch-icon.png -------------------------------------------------------------------------------- /public/images/og-unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/og-unknown.png -------------------------------------------------------------------------------- /public/images/team/josh.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/josh.jpg -------------------------------------------------------------------------------- /public/images/team/mike.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/mike.jpg -------------------------------------------------------------------------------- /public/images/team/seth.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/seth.jpg -------------------------------------------------------------------------------- /public/images/team/yuzhi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/yuzhi.jpg -------------------------------------------------------------------------------- /public/images/meta-gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/meta-gradient.png -------------------------------------------------------------------------------- /public/images/og-community.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/og-community.png -------------------------------------------------------------------------------- /public/images/og-reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/og-reference.png -------------------------------------------------------------------------------- /public/images/team/acdlite.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/acdlite.jpg -------------------------------------------------------------------------------- /public/images/team/gaearon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/gaearon.jpg -------------------------------------------------------------------------------- /public/images/team/hendrik.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/hendrik.jpg -------------------------------------------------------------------------------- /public/images/team/jordan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/jordan.jpg -------------------------------------------------------------------------------- /public/images/team/lauren.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/lauren.jpg -------------------------------------------------------------------------------- /public/images/team/lesiutin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/lesiutin.jpg -------------------------------------------------------------------------------- /public/images/team/pieter.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/pieter.jpg -------------------------------------------------------------------------------- /public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /public/android-chrome-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/android-chrome-384x384.png -------------------------------------------------------------------------------- /public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /public/images/home/videos/rn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/videos/rn.jpg -------------------------------------------------------------------------------- /public/images/home/videos/rsc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/videos/rsc.jpg -------------------------------------------------------------------------------- /public/images/team/eli-white.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/eli-white.jpg -------------------------------------------------------------------------------- /public/images/team/jack-pope.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/jack-pope.jpg -------------------------------------------------------------------------------- /public/images/team/jasonbonta.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/jasonbonta.jpg -------------------------------------------------------------------------------- /public/images/team/sophiebits.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/sophiebits.jpg -------------------------------------------------------------------------------- /src/content/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: home 3 | title: React 4 | permalink: index.html 5 | --- 6 | 7 | {/* See HomeContent.js */} -------------------------------------------------------------------------------- /public/images/home/conf2019/alex.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/alex.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/jed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/jed.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/jenn.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/jenn.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/joe.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/joe.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/lee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/lee.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/luca.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/luca.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/maja.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/maja.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/nat.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/nat.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/tae.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/tae.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/tom.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/tom.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/eric.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/eric.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/juan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/juan.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/lyle.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/lyle.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/rick.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/rick.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/tafu.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/tafu.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/xuan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/xuan.jpg -------------------------------------------------------------------------------- /public/images/home/videos/hooks.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/videos/hooks.jpg -------------------------------------------------------------------------------- /public/images/meta-gradient-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/meta-gradient-dark.png -------------------------------------------------------------------------------- /public/images/team/matt-carroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/matt-carroll.png -------------------------------------------------------------------------------- /public/images/team/mofei-zhang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/mofei-zhang.png -------------------------------------------------------------------------------- /public/images/team/rickhanlonii.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/rickhanlonii.jpg -------------------------------------------------------------------------------- /public/images/team/sebmarkbage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/sebmarkbage.jpg -------------------------------------------------------------------------------- /public/images/team/sebsilbermann.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/team/sebsilbermann.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/ashley.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/ashley.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/becca.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/becca.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/brian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/brian.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/frank.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/frank.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/lizzie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/lizzie.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/sophie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/sophie.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/tania.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/tania.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/tejas.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/tejas.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/yuzhi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/yuzhi.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/andrew.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/andrew.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/brian.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/brian.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/daishi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/daishi.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/debbie.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/debbie.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/delba.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/delba.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/diego.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/diego.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/helen.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/helen.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/lauren.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/lauren.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/linton.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/linton.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/rachel.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/rachel.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/robert.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/robert.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/roman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/roman.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/sarah.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/sarah.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/shruti.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/shruti.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/steven.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/steven.jpg -------------------------------------------------------------------------------- /public/images/tutorial/empty-board.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/empty-board.png -------------------------------------------------------------------------------- /public/fonts/Source-Code-Pro-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/fonts/Source-Code-Pro-Bold.woff2 -------------------------------------------------------------------------------- /public/images/docs/diagrams/prerender.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/prerender.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/prewarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/prewarm.png -------------------------------------------------------------------------------- /public/images/home/conf2019/alexandra.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/alexandra.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/brittany.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/brittany.jpg -------------------------------------------------------------------------------- /public/images/home/conf2019/cameron.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2019/cameron.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/aakansha.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/aakansha.jpg -------------------------------------------------------------------------------- /public/images/home/conf2021/shaundai.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/conf2021/shaundai.jpg -------------------------------------------------------------------------------- /public/images/home/videos/rethinking.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/videos/rethinking.jpg -------------------------------------------------------------------------------- /public/images/tutorial/o-replaces-x.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/o-replaces-x.gif -------------------------------------------------------------------------------- /public/fonts/Source-Code-Pro-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/fonts/Source-Code-Pro-Regular.woff2 -------------------------------------------------------------------------------- /public/images/docs/diagrams/render_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/render_tree.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_ref.png -------------------------------------------------------------------------------- /public/images/home/videos/documentary.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/videos/documentary.webp -------------------------------------------------------------------------------- /public/images/tutorial/devtools-select.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/devtools-select.gif -------------------------------------------------------------------------------- /public/images/tutorial/x-filled-square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/x-filled-square.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/prerender.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/prerender.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/prewarm.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/prewarm.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/writing_jsx_js.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/writing_jsx_js.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_inputs1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_inputs1.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_inputs2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_inputs2.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_render1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_render1.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_render2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_render2.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_render3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_render3.png -------------------------------------------------------------------------------- /public/images/docs/s_thinking-in-react_ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/s_thinking-in-react_ui.png -------------------------------------------------------------------------------- /public/images/tutorial/number-filled-board.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/number-filled-board.png -------------------------------------------------------------------------------- /public/images/tutorial/tictac-adding-x-s.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/tictac-adding-x-s.gif -------------------------------------------------------------------------------- /public/images/docs/diagrams/render_tree.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/render_tree.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/writing_jsx_form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/writing_jsx_form.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/writing_jsx_html.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/writing_jsx_html.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_rerender1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_rerender1.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_rerender2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_rerender2.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_rerender3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_rerender3.png -------------------------------------------------------------------------------- /public/images/docs/react-devtools-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/react-devtools-extension.png -------------------------------------------------------------------------------- /public/images/docs/react-devtools-standalone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/react-devtools-standalone.png -------------------------------------------------------------------------------- /public/images/home/community/react_conf_fun.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/community/react_conf_fun.webp -------------------------------------------------------------------------------- /public/images/home/community/react_conf_nat.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/community/react_conf_nat.webp -------------------------------------------------------------------------------- /public/images/tutorial/codesandbox-devtools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/codesandbox-devtools.png -------------------------------------------------------------------------------- /public/images/tutorial/nine-x-filled-squares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/nine-x-filled-squares.png -------------------------------------------------------------------------------- /public/images/tutorial/two-x-filled-squares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/two-x-filled-squares.png -------------------------------------------------------------------------------- /public/images/blog/react-labs-april-2025/flip.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-labs-april-2025/flip.gif -------------------------------------------------------------------------------- /public/images/docs/diagrams/19_2_batching_after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/19_2_batching_after.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/generic_render_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/generic_render_tree.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_data_child.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_data_child.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_data_parent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_data_parent.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_state_child.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_state_child.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/writing_jsx_js.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/writing_jsx_js.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/writing_jsx_sidebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/writing_jsx_sidebar.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/overview.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/scheduler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/scheduler.png -------------------------------------------------------------------------------- /public/images/docs/react-devtools-usedebugvalue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/react-devtools-usedebugvalue.png -------------------------------------------------------------------------------- /public/images/home/community/react_conf_selfie.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/community/react_conf_selfie.webp -------------------------------------------------------------------------------- /public/images/home/community/react_india_sunil.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/community/react_india_sunil.webp -------------------------------------------------------------------------------- /public/images/home/community/react_india_team.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/community/react_india_team.webp -------------------------------------------------------------------------------- /public/images/tutorial/board-filled-with-ones.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/board-filled-with-ones.png -------------------------------------------------------------------------------- /public/images/tutorial/board-filled-with-value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/board-filled-with-value.png -------------------------------------------------------------------------------- /eslint-local-rules/__tests__/fixtures/src/content/mixed-language.md: -------------------------------------------------------------------------------- 1 | ```bash 2 | setCount() 3 | ``` 4 | 5 | ```txt 6 | import {useState} from 'react'; 7 | ``` 8 | -------------------------------------------------------------------------------- /public/images/docs/diagrams/19_2_batching_before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/19_2_batching_before.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_tree.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_state_parent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_state_parent.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/writing_jsx_form.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/writing_jsx_form.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/writing_jsx_html.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/writing_jsx_html.dark.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_browser-paint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_browser-paint.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_children-prop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_children-prop.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_puritea-recipe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_puritea-recipe.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_react-batching.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_react-batching.png -------------------------------------------------------------------------------- /public/images/docs/s_thinking-in-react_ui_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/s_thinking-in-react_ui_outline.png -------------------------------------------------------------------------------- /public/images/home/community/react_conf_elizabet.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/community/react_conf_elizabet.webp -------------------------------------------------------------------------------- /public/images/home/community/react_conf_hallway.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/community/react_conf_hallway.webp -------------------------------------------------------------------------------- /public/images/home/community/react_india_hallway.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/community/react_india_hallway.webp -------------------------------------------------------------------------------- /public/images/home/community/react_india_selfie.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/home/community/react_india_selfie.webp -------------------------------------------------------------------------------- /public/images/blog/introducing-react-dev/home-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/introducing-react-dev/home-dark.png -------------------------------------------------------------------------------- /public/images/blog/introducing-react-dev/home-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/introducing-react-dev/home-light.png -------------------------------------------------------------------------------- /public/images/blog/react-labs-april-2025/perf_tracks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-labs-april-2025/perf_tracks.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/19_2_batching_after.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/19_2_batching_after.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/conditional_render_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/conditional_render_tree.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/generic_dependency_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/generic_dependency_tree.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/generic_render_tree.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/generic_render_tree.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/module_dependency_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/module_dependency_tree.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/passing_data_context_far.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/passing_data_context_far.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/responding_to_input_flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/responding_to_input_flow.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_data_child.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_data_child.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_data_parent.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_data_parent.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_state_child.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_state_child.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/use_client_render_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/use_client_render_tree.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/writing_jsx_sidebar.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/writing_jsx_sidebar.dark.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_state-snapshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_state-snapshot1.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_state-snapshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_state-snapshot2.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_state-snapshot3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_state-snapshot3.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/changed-props.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/changed-props.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/overview.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/overview.dark.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/scheduler.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/scheduler.dark.png -------------------------------------------------------------------------------- /public/images/blog/react-labs-april-2025/perf_tracks.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-labs-april-2025/perf_tracks.webp -------------------------------------------------------------------------------- /public/images/docs/diagrams/19_2_batching_before.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/19_2_batching_before.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/passing_data_context_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/passing_data_context_close.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/passing_data_lifting_state.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/passing_data_lifting_state.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/passing_data_prop_drilling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/passing_data_prop_drilling.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_pt1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_pt1.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_pt2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_pt2.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_dom_tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_dom_tree.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_increment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_increment.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_tree.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_tree.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_data_child_clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_data_child_clicked.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_state_parent.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_state_parent.dark.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_render-and-commit1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_render-and-commit1.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_render-and-commit2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_render-and-commit2.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_render-and-commit3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_render-and-commit3.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/scheduler-update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/scheduler-update.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/server-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/server-overview.png -------------------------------------------------------------------------------- /public/images/tutorial/react-starter-code-codesandbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/tutorial/react-starter-code-codesandbox.png -------------------------------------------------------------------------------- /public/images/blog/react-foundation/react_foundation_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-foundation/react_foundation_logo.png -------------------------------------------------------------------------------- /public/images/blog/react-labs-april-2025/perf_tracks_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-labs-april-2025/perf_tracks_dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/conditional_render_tree.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/conditional_render_tree.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/generic_dependency_tree.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/generic_dependency_tree.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/module_dependency_tree.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/module_dependency_tree.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/passing_data_context_far.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/passing_data_context_far.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/responding_to_input_flow.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/responding_to_input_flow.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_data_parent_clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_data_parent_clicked.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_state_child_clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_state_child_clicked.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_state_parent_clicked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_state_parent_clicked.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/use_client_module_dependency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/use_client_module_dependency.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/use_client_render_tree.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/use_client_render_tree.dark.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/changed-props.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/changed-props.dark.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/components-effects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/components-effects.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/components-render.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/components-render.png -------------------------------------------------------------------------------- /public/images/blog/react-foundation/react_foundation_logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-foundation/react_foundation_logo.webp -------------------------------------------------------------------------------- /public/images/blog/react-labs-april-2025/perf_tracks_dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-labs-april-2025/perf_tracks_dark.webp -------------------------------------------------------------------------------- /public/images/docs/diagrams/passing_data_context_close.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/passing_data_context_close.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/passing_data_lifting_state.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/passing_data_lifting_state.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/passing_data_prop_drilling.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/passing_data_prop_drilling.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_add_component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_add_component.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_pt1.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_pt1.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_pt2.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_pt2.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_same_pt1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_same_pt1.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_same_pt2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_same_pt2.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_dom_tree.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_dom_tree.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_increment.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_increment.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_same_component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_same_component.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_data_child_clicked.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_data_child_clicked.dark.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/scheduler-update.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/scheduler-update.dark.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/server-overview.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/server-overview.dark.png -------------------------------------------------------------------------------- /public/images/blog/react-foundation/react_foundation_logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-foundation/react_foundation_logo_dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_position_p1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_position_p1.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_position_p2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_position_p2.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_position_p3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_position_p3.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_remove_component.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_remove_component.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_data_parent_clicked.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_data_parent_clicked.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_state_child_clicked.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_state_child_clicked.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/sharing_state_parent_clicked.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/sharing_state_parent_clicked.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/use_client_module_dependency.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/use_client_module_dependency.dark.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_declarative-ui-programming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_declarative-ui-programming.png -------------------------------------------------------------------------------- /public/images/docs/illustrations/i_imperative-ui-programming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/illustrations/i_imperative-ui-programming.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/components-effects.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/components-effects.dark.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/components-render.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/components-render.dark.png -------------------------------------------------------------------------------- /eslint-local-rules/__tests__/fixtures/src/content/stale-expected-error.md: -------------------------------------------------------------------------------- 1 | ```jsx {expectedErrors: {'react-compiler': [3]}} 2 | function Hello() { 3 | return

Hello

; 4 | } 5 | ``` 6 | -------------------------------------------------------------------------------- /public/images/blog/react-foundation/react_foundation_logo_dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-foundation/react_foundation_logo_dark.webp -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_add_component.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_add_component.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_same_pt1.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_same_pt1.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_same_pt2.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_same_pt2.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_same_component.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_same_component.dark.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/scheduler-cascading-update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/scheduler-cascading-update.png -------------------------------------------------------------------------------- /public/images/blog/react-foundation/react_foundation_member_logos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-foundation/react_foundation_member_logos.png -------------------------------------------------------------------------------- /public/images/blog/react-foundation/react_foundation_member_logos.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-foundation/react_foundation_member_logos.webp -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_position_p1.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_position_p1.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_position_p2.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_position_p2.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_diff_position_p3.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_diff_position_p3.dark.png -------------------------------------------------------------------------------- /public/images/docs/diagrams/preserving_state_remove_component.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/diagrams/preserving_state_remove_component.dark.png -------------------------------------------------------------------------------- /public/images/docs/performance-tracks/scheduler-cascading-update.dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/docs/performance-tracks/scheduler-cascading-update.dark.png -------------------------------------------------------------------------------- /public/images/blog/react-foundation/react_foundation_member_logos_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-foundation/react_foundation_member_logos_dark.png -------------------------------------------------------------------------------- /public/images/blog/react-foundation/react_foundation_member_logos_dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/reactjs/ta.react.dev/HEAD/public/images/blog/react-foundation/react_foundation_member_logos_dark.webp -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. 6 | -------------------------------------------------------------------------------- /eslint-local-rules/__tests__/fixtures/src/content/basic-error.md: -------------------------------------------------------------------------------- 1 | ```jsx 2 | import {useState} from 'react'; 3 | function Counter() { 4 | const [count, setCount] = useState(0); 5 | setCount(count + 1); 6 | return
{count}
; 7 | } 8 | ``` 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "npm" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | # Disable Dependabot. Doing it here so it propagates to translation forks. 8 | open-pull-requests-limit: 0 9 | -------------------------------------------------------------------------------- /eslint-local-rules/parser.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | module.exports = require('eslint-mdx'); 9 | -------------------------------------------------------------------------------- /eslint-local-rules/__tests__/fixtures/src/content/suppressed-error.md: -------------------------------------------------------------------------------- 1 | ```jsx {expectedErrors: {'react-compiler': [4]}} 2 | import {useState} from 'react'; 3 | function Counter() { 4 | const [count, setCount] = useState(0); 5 | setCount(count + 1); 6 | return
{count}
; 7 | } 8 | ``` 9 | -------------------------------------------------------------------------------- /eslint-local-rules/__tests__/fixtures/src/content/malformed-metadata.md: -------------------------------------------------------------------------------- 1 | ```jsx {expectedErrors: {'react-compiler': 'invalid'}} 2 | import {useState} from 'react'; 3 | function Counter() { 4 | const [count, setCount] = useState(0); 5 | setCount(count + 1); 6 | return
{count}
; 7 | } 8 | ``` 9 | -------------------------------------------------------------------------------- /public/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #2b5797 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /eslint-local-rules/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-plugin-local-rules", 3 | "version": "0.0.0", 4 | "main": "index.js", 5 | "private": "true", 6 | "scripts": { 7 | "test": "node __tests__/lint-markdown-code-blocks.test.js" 8 | }, 9 | "devDependencies": { 10 | "eslint-mdx": "^2" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 12 | -------------------------------------------------------------------------------- /eslint-local-rules/__tests__/fixtures/src/content/duplicate-metadata.md: -------------------------------------------------------------------------------- 1 | ```jsx title="Counter" {expectedErrors: {'react-compiler': [99]}} {expectedErrors: {'react-compiler': [2]}} 2 | import {useState} from 'react'; 3 | function Counter() { 4 | const [count, setCount] = useState(0); 5 | setCount(count + 1); 6 | return
{count}
; 7 | } 8 | ``` 9 | -------------------------------------------------------------------------------- /src/components/Layout/TopNav/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | export {default as TopNav} from './TopNav'; 13 | -------------------------------------------------------------------------------- /src/pages/errors/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | import ErrorDecoderPage from './[errorCode]'; 9 | export default ErrorDecoderPage; 10 | export {getStaticProps} from './[errorCode]'; 11 | -------------------------------------------------------------------------------- /src/components/Layout/SidebarNav/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | export {default as SidebarNav} from './SidebarNav'; 13 | -------------------------------------------------------------------------------- /scripts/generateRss.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | const {generateRssFeed} = require('../src/utils/rss'); 12 | 13 | generateRssFeed(); 14 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "bracketSpacing": false, 3 | "singleQuote": true, 4 | "bracketSameLine": true, 5 | "trailingComma": "es5", 6 | "printWidth": 80, 7 | "overrides": [ 8 | { 9 | "files": "*.css", 10 | "options": { 11 | "parser": "css" 12 | } 13 | }, 14 | { 15 | "files": "*.md", 16 | "options": { 17 | "parser": "mdx" 18 | } 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /src/utils/rafShim.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | // Used in next.config.js to remove the raf transitive dependency. 13 | export default window.requestAnimationFrame; 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: 📃 Bugs in React 3 | url: https://github.com/facebook/react/issues/new/choose 4 | about: This issue tracker is not for bugs in React. Please file React issues here. 5 | - name: 🤔 Questions and Help 6 | url: https://reactjs.org/community/support.html 7 | about: This issue tracker is not for support questions. Please refer to the React community's help and discussion forums. 8 | -------------------------------------------------------------------------------- /eslint-local-rules/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | const lintMarkdownCodeBlocks = require('./rules/lint-markdown-code-blocks'); 9 | 10 | module.exports = { 11 | rules: { 12 | 'lint-markdown-code-blocks': lintMarkdownCodeBlocks, 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /src/utils/processShim.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | // Used in next.config.js to remove the process transitive dependency. 13 | module.exports = { 14 | env: {}, 15 | cwd() {}, 16 | }; 17 | -------------------------------------------------------------------------------- /src/components/Layout/Sidebar/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | export {SidebarButton} from './SidebarButton'; 13 | export {SidebarLink} from './SidebarLink'; 14 | export {SidebarRouteTree} from './SidebarRouteTree'; 15 | -------------------------------------------------------------------------------- /public/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "React", 3 | "short_name": "React", 4 | "icons": [ 5 | { 6 | "src": "/android-chrome-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png" 9 | }, 10 | { 11 | "src": "/android-chrome-384x384.png", 12 | "sizes": "384x384", 13 | "type": "image/png" 14 | } 15 | ], 16 | "theme_color": "#23272f", 17 | "background_color": "#23272f", 18 | "display": "standalone" 19 | } 20 | -------------------------------------------------------------------------------- /src/content/warnings/special-props.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Special Props Warning 3 | --- 4 | 5 | Most props on a JSX element are passed on to the component, however, there are two special props (`ref` and `key`) which are used by React, and are thus not forwarded to the component. 6 | 7 | For instance, you can't read `props.key` from a component. If you need to access the same value within the child component, you should pass it as a different prop (ex: `` and read `props.id`). While this may seem redundant, it's important to separate app logic from hints to React. 8 | -------------------------------------------------------------------------------- /src/content/errors/generic.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | In the minified production build of React, we avoid sending down full error messages in order to reduce the number of bytes sent over the wire. 4 | 5 | 6 | 7 | We highly recommend using the development build locally when debugging your app since it tracks additional debug info and provides helpful warnings about potential problems in your apps, but if you encounter an exception while using the production build, this page will reassemble the original error message. 8 | 9 | The full text of the error you just encountered is: 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/components/MDX/LanguagesContext.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {createContext} from 'react'; 13 | 14 | export type LanguageItem = { 15 | code: string; 16 | name: string; 17 | enName: string; 18 | }; 19 | export type Languages = Array; 20 | 21 | export const LanguagesContext = createContext(null); 22 | -------------------------------------------------------------------------------- /src/components/MDX/TocContext.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {createContext} from 'react'; 13 | import type {ReactNode} from 'react'; 14 | 15 | export type TocItem = { 16 | url: string; 17 | text: ReactNode; 18 | depth: number; 19 | }; 20 | export type Toc = Array; 21 | 22 | export const TocContext = createContext([]); 23 | -------------------------------------------------------------------------------- /src/components/MDX/Challenges/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | export {Challenges} from './Challenges'; 14 | 15 | export function Hint({children}: {children: React.ReactNode}) { 16 | return
{children}
; 17 | } 18 | 19 | export function Solution({children}: {children: React.ReactNode}) { 20 | return
{children}
; 21 | } 22 | -------------------------------------------------------------------------------- /src/content/errors/index.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ரியாக்டின் மினிஃபைடு புரொடக்ஷன் பில்டில், நெட்வொர்க் வழியாக அனுப்பப்படும் பைட்ஸின் அளவை குறைக்க, முழு எரர் மெசேஜ்களை அனுப்பாமல் இருக்கிறோம். 4 | 5 | 6 | 7 | 8 | உங்கள் ஆப்பை டிபக் செய்யும்போது லோக்கலாக டெவலப்மென்ட் பில்டை பயன்படுத்தும்படி நாம் வலியுறுத்துகிறோம்; அது கூடுதல் டிபக் இன்போவை டிராக் செய்து, உங்கள் ஆப்ஸில் இருக்கக்கூடிய பிரச்சினைகள் குறித்து உதவிகரமான வார்னிங்ஸ்களை வழங்கும். ஆனால் புரொடக்ஷன் பில்டைப் பயன்படுத்தும் போது எக்செப்ஷன் ஏற்பட்டால், அந்த எரர் மெசேஜில் அந்த எரருக்கான டாக்ஸ்க்கு ஒரு லிங்க் மட்டும் இருக்கும். 9 | 10 | ஒரு உதாரணத்திற்கு, இதைப் பாருங்கள்: [https://react.dev/errors/149](/errors/149). 11 | -------------------------------------------------------------------------------- /src/types/docsearch-react-modal.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | // This module must be declared and because the dynamic import in 13 | // "src/components/Search.tsx" is not able to resolve the types from 14 | // the package. 15 | declare module '@docsearch/react/modal' { 16 | // re-exports the types from @docsearch/react/dist/esm/index.d.ts 17 | export * from '@docsearch/react/dist/esm/index'; 18 | } 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | tsconfig.tsbuildinfo 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env.local 30 | .env.development.local 31 | .env.test.local 32 | .env.production.local 33 | 34 | # vercel 35 | .vercel 36 | 37 | # external fonts 38 | public/fonts/**/Optimistic_*.woff2 39 | 40 | # rss 41 | public/rss.xml 42 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | module.exports = { 13 | plugins: { 14 | tailwindcss: {}, 15 | autoprefixer: {}, 16 | 'postcss-flexbugs-fixes': {}, 17 | 'postcss-preset-env': { 18 | autoprefixer: { 19 | flexbox: 'no-2009', 20 | }, 21 | stage: 3, 22 | features: { 23 | 'custom-properties': false, 24 | }, 25 | }, 26 | }, 27 | }; 28 | -------------------------------------------------------------------------------- /src/content/reference/rsc/directives.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Directives 3 | --- 4 | 5 | 6 | 7 | Directives are for use in [React Server Components](/reference/rsc/server-components). 8 | 9 | 10 | 11 | 12 | 13 | Directives provide instructions to [bundlers compatible with React Server Components](/learn/creating-a-react-app#full-stack-frameworks). 14 | 15 | 16 | 17 | --- 18 | 19 | ## Source code directives {/*source-code-directives*/} 20 | 21 | * [`'use client'`](/reference/rsc/use-client) lets you mark what code runs on the client. 22 | * [`'use server'`](/reference/rsc/use-server) marks server-side functions that can be called from client-side code. 23 | -------------------------------------------------------------------------------- /src/components/MDX/Intro.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | 14 | export interface IntroProps { 15 | children?: React.ReactNode; 16 | } 17 | 18 | function Intro({children}: IntroProps) { 19 | return ( 20 |
21 | {children} 22 |
23 | ); 24 | } 25 | 26 | export default Intro; 27 | -------------------------------------------------------------------------------- /src/content/errors/377.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | In the minified production build of React, we avoid sending down full error messages in order to reduce the number of bytes sent over the wire. 4 | 5 | 6 | 7 | We highly recommend using the development build locally when debugging your app since it tracks additional debug info and provides helpful warnings about potential problems in your apps, but if you encounter an exception while using the production build, this page will reassemble the original error message. 8 | 9 | The full text of the error you just encountered is: 10 | 11 | 12 | 13 | This error occurs when you pass a BigInt value from a Server Component to a Client Component. 14 | -------------------------------------------------------------------------------- /src/components/MDX/Recap.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | import {H2} from './Heading'; 14 | 15 | interface RecapProps { 16 | children: React.ReactNode; 17 | } 18 | 19 | function Recap({children}: RecapProps) { 20 | return ( 21 |
22 |

23 | Recap 24 |

25 | {children} 26 |
27 | ); 28 | } 29 | 30 | export default Recap; 31 | -------------------------------------------------------------------------------- /src/components/ExternalLink.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | import type {DetailedHTMLProps, AnchorHTMLAttributes} from 'react'; 12 | 13 | export function ExternalLink({ 14 | href, 15 | target, 16 | children, 17 | ...props 18 | }: DetailedHTMLProps< 19 | AnchorHTMLAttributes, 20 | HTMLAnchorElement 21 | >) { 22 | return ( 23 | 24 | {children} 25 | 26 | ); 27 | } 28 | -------------------------------------------------------------------------------- /src/components/MDX/DiagramGroup.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {ReactNode} from 'react'; 13 | 14 | interface DiagramGroupProps { 15 | children: ReactNode; 16 | } 17 | 18 | export function DiagramGroup({children}: DiagramGroupProps) { 19 | return ( 20 |
21 | {children} 22 |
23 | ); 24 | } 25 | 26 | export default DiagramGroup; 27 | -------------------------------------------------------------------------------- /src/utils/finishedTranslations.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | // This is a list of languages with enough translated content. 9 | // Add more languages here when they have enough content. 10 | // Please DO NOT edit this list without a discussion in the reactjs/react.dev repo. 11 | // It must be the same between all translations. 12 | // This will also affect the 'Translations' article. 13 | 14 | // prettier-ignore 15 | export const finishedTranslations = [ 16 | 'en', 17 | 'zh-hans', 18 | 'es', 19 | 'fr', 20 | 'ja', 21 | 'tr', 22 | 'ko' 23 | ]; 24 | -------------------------------------------------------------------------------- /src/content/warnings/invalid-aria-prop.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Invalid ARIA Prop Warning 3 | --- 4 | 5 | This warning will fire if you attempt to render a DOM element with an `aria-*` prop that does not exist in the Web Accessibility Initiative (WAI) Accessible Rich Internet Application (ARIA) [specification](https://www.w3.org/TR/wai-aria-1.1/#states_and_properties). 6 | 7 | 1. If you feel that you are using a valid prop, check the spelling carefully. `aria-labelledby` and `aria-activedescendant` are often misspelled. 8 | 9 | 2. If you wrote `aria-role`, you may have meant `role`. 10 | 11 | 3. Otherwise, if you're on the latest version of React DOM and verified that you're using a valid property name listed in the ARIA specification, please [report a bug](https://github.com/facebook/react/issues/new/choose). 12 | -------------------------------------------------------------------------------- /public/js/jsfiddle-integration-babel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | // Do not delete or move this file. 9 | // Many fiddles reference it so we have to keep it here. 10 | (function () { 11 | var tag = document.querySelector( 12 | 'script[type="application/javascript;version=1.7"]' 13 | ); 14 | if (!tag || tag.textContent.indexOf('window.onload=function(){') !== -1) { 15 | alert( 16 | 'Bad JSFiddle configuration, please fork the original React JSFiddle' 17 | ); 18 | } 19 | tag.setAttribute('type', 'text/babel'); 20 | tag.textContent = tag.textContent.replace(/^\/\/(function IconError({ 15 | className, 16 | }) { 17 | return ( 18 | 24 | 25 | 26 | 27 | 28 | ); 29 | }); 30 | -------------------------------------------------------------------------------- /src/siteConfig.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | exports.siteConfig = { 12 | version: '19.2', 13 | // -------------------------------------- 14 | // Translations should replace these lines: 15 | languageCode: 'en', 16 | hasLegacySite: true, 17 | isRTL: false, 18 | // -------------------------------------- 19 | copyright: `Copyright © ${new Date().getFullYear()} Facebook Inc. All Rights Reserved.`, 20 | repoUrl: 'https://github.com/facebook/react', 21 | twitterUrl: 'https://twitter.com/reactjs', 22 | algolia: { 23 | appId: '1FCF9AYYAT', 24 | apiKey: '1b7ad4e1c89e645e351e59d40544eda1', 25 | indexName: 'beta-react', 26 | }, 27 | }; 28 | -------------------------------------------------------------------------------- /src/components/MDX/Sandpack/ErrorMessage.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | interface ErrorType { 13 | title?: string; 14 | message: string; 15 | column?: number; 16 | line?: number; 17 | path?: string; 18 | } 19 | 20 | export function ErrorMessage({error, ...props}: {error: ErrorType}) { 21 | const {message, title} = error; 22 | 23 | return ( 24 |
25 |

{title || 'Error'}

26 |
27 |         {message}
28 |       
29 |
30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /src/utils/analytics.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | let buffer: Array = []; 13 | let galite: null | Function = null; 14 | let galitePromise: null | Promise = null; 15 | 16 | export function ga(...args: any[]): void { 17 | if (typeof galite === 'function') { 18 | galite.apply(null, args); 19 | return; 20 | } 21 | buffer.push(args); 22 | if (!galitePromise) { 23 | // @ts-ignore 24 | galitePromise = import('ga-lite').then((mod) => { 25 | galite = mod.default; 26 | galitePromise = null; 27 | buffer.forEach((args) => { 28 | mod.default.apply(null, args); 29 | }); 30 | buffer = []; 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/components/Icon/IconClose.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import type {SVGProps} from 'react'; 14 | 15 | export const IconClose = memo>(function IconClose( 16 | props 17 | ) { 18 | return ( 19 | 30 | 31 | 32 | 33 | ); 34 | }); 35 | -------------------------------------------------------------------------------- /src/components/Logo.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | import type {SVGProps} from 'react'; 12 | 13 | export function Logo(props: SVGProps) { 14 | return ( 15 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /src/components/Icon/IconRss.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import type {SVGProps} from 'react'; 14 | 15 | export const IconRss = memo>(function IconRss(props) { 16 | return ( 17 | 28 | 29 | 30 | 31 | 32 | ); 33 | }); 34 | -------------------------------------------------------------------------------- /src/components/Icon/IconTwitter.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import type {SVGProps} from 'react'; 14 | 15 | export const IconTwitter = memo>(function IconTwitter( 16 | props 17 | ) { 18 | return ( 19 | 26 | 27 | 28 | 29 | ); 30 | }); 31 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "strict": true, 12 | "noImplicitAny": true, 13 | "noImplicitReturns": true, 14 | "noImplicitThis": true, 15 | "strictNullChecks": true, 16 | "forceConsistentCasingInFileNames": true, 17 | "noEmit": true, 18 | "esModuleInterop": true, 19 | "module": "esnext", 20 | "moduleResolution": "node", 21 | "resolveJsonModule": true, 22 | "isolatedModules": true, 23 | "jsx": "preserve", 24 | "baseUrl": "src", 25 | "incremental": true, 26 | "plugins": [ 27 | { 28 | "name": "next" 29 | } 30 | ] 31 | }, 32 | "include": [ 33 | "next-env.d.ts", 34 | "src/**/*.ts", 35 | "src/**/*.tsx", 36 | ".next/types/**/*.ts" 37 | ], 38 | "exclude": [ 39 | "node_modules" 40 | ] 41 | } 42 | -------------------------------------------------------------------------------- /src/components/MDX/Sandpack/ClearButton.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | import {IconClose} from '../../Icon/IconClose'; 14 | export interface ClearButtonProps { 15 | onClear: () => void; 16 | } 17 | 18 | export function ClearButton({onClear}: ClearButtonProps) { 19 | return ( 20 | 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /src/components/Icon/IconLink.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import type {SVGProps} from 'react'; 14 | 15 | export const IconLink = memo>(function IconLink(props) { 16 | return ( 17 | 24 | 29 | 30 | ); 31 | }); 32 | -------------------------------------------------------------------------------- /src/components/MDX/Sandpack/ReloadButton.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | import {IconRestart} from '../../Icon/IconRestart'; 14 | export interface ReloadButtonProps { 15 | onReload: () => void; 16 | } 17 | 18 | export function ReloadButton({onReload}: ReloadButtonProps) { 19 | return ( 20 | 28 | ); 29 | } 30 | -------------------------------------------------------------------------------- /src/components/Icon/IconCodeBlock.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | 14 | export const IconCodeBlock = memo( 15 | function IconCodeBlock({className}) { 16 | return ( 17 | 24 | 28 | 29 | ); 30 | } 31 | ); 32 | -------------------------------------------------------------------------------- /src/components/Icon/IconHamburger.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import type {SVGProps} from 'react'; 14 | 15 | export const IconHamburger = memo>( 16 | function IconHamburger(props) { 17 | return ( 18 | 28 | 29 | 30 | 31 | 32 | ); 33 | } 34 | ); 35 | -------------------------------------------------------------------------------- /.github/workflows/site_lint.yml: -------------------------------------------------------------------------------- 1 | name: Site Lint / Heading ID check 2 | 3 | on: 4 | push: 5 | branches: 6 | - main # change this if your default branch is named differently 7 | pull_request: 8 | types: [opened, synchronize, reopened] 9 | 10 | permissions: {} 11 | 12 | jobs: 13 | lint: 14 | runs-on: ubuntu-latest 15 | 16 | name: Lint on node 20.x and ubuntu-latest 17 | 18 | steps: 19 | - uses: actions/checkout@v4 20 | - name: Use Node.js 20.x 21 | uses: actions/setup-node@v4 22 | with: 23 | node-version: 20.x 24 | cache: yarn 25 | cache-dependency-path: yarn.lock 26 | 27 | - name: Restore cached node_modules 28 | uses: actions/cache@v4 29 | with: 30 | path: '**/node_modules' 31 | key: node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }} 32 | 33 | - name: Install deps 34 | run: yarn install --frozen-lockfile 35 | 36 | - name: Lint codebase 37 | run: yarn ci-check 38 | -------------------------------------------------------------------------------- /src/components/Icon/IconSearch.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import type {SVGProps} from 'react'; 14 | 15 | export const IconSearch = memo>(function IconSearch( 16 | props 17 | ) { 18 | return ( 19 | 20 | 28 | 29 | ); 30 | }); 31 | -------------------------------------------------------------------------------- /src/components/MDX/Sandpack/OpenInCodeSandboxButton.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {UnstyledOpenInCodeSandboxButton} from '@codesandbox/sandpack-react/unstyled'; 13 | import {IconNewPage} from '../../Icon/IconNewPage'; 14 | 15 | export const OpenInCodeSandboxButton = () => { 16 | return ( 17 | 20 | 25 | Fork 26 | 27 | ); 28 | }; 29 | -------------------------------------------------------------------------------- /src/content/reference/react/components.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Built-in React Components" 3 | --- 4 | 5 | 6 | 7 | React exposes a few built-in components that you can use in your JSX. 8 | 9 | 10 | 11 | --- 12 | 13 | ## Built-in components {/*built-in-components*/} 14 | 15 | * [``](/reference/react/Fragment), alternatively written as `<>...`, lets you group multiple JSX nodes together. 16 | * [``](/reference/react/Profiler) lets you measure rendering performance of a React tree programmatically. 17 | * [``](/reference/react/Suspense) lets you display a fallback while the child components are loading. 18 | * [``](/reference/react/StrictMode) enables extra development-only checks that help you find bugs early. 19 | * [``](/reference/react/Activity) lets you hide and restore the UI and internal state of its children. 20 | 21 | --- 22 | 23 | ## Your own components {/*your-own-components*/} 24 | 25 | You can also [define your own components](/learn/your-first-component) as JavaScript functions. 26 | -------------------------------------------------------------------------------- /src/content/reference/react-dom/client/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Client React DOM APIs 3 | --- 4 | 5 | 6 | 7 | The `react-dom/client` APIs let you render React components on the client (in the browser). These APIs are typically used at the top level of your app to initialize your React tree. A [framework](/learn/creating-a-react-app#full-stack-frameworks) may call them for you. Most of your components don't need to import or use them. 8 | 9 | 10 | 11 | --- 12 | 13 | ## Client APIs {/*client-apis*/} 14 | 15 | * [`createRoot`](/reference/react-dom/client/createRoot) lets you create a root to display React components inside a browser DOM node. 16 | * [`hydrateRoot`](/reference/react-dom/client/hydrateRoot) lets you display React components inside a browser DOM node whose HTML content was previously generated by [`react-dom/server`.](/reference/react-dom/server) 17 | 18 | --- 19 | 20 | ## Browser support {/*browser-support*/} 21 | 22 | React supports all popular browsers, including Internet Explorer 9 and above. Some polyfills are required for older browsers such as IE 9 and IE 10. -------------------------------------------------------------------------------- /src/components/MDX/MDXComponents.module.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | */ 4 | 5 | /* Stop purging. */ 6 | .markdown p { 7 | @apply mb-4 leading-7 whitespace-pre-wrap text-gray-70; 8 | } 9 | 10 | .markdown ol { 11 | @apply mb-4 ms-8 list-decimal; 12 | } 13 | 14 | .markdown ul { 15 | @apply mb-4 ms-8 list-disc; 16 | } 17 | 18 | .markdown h1 { 19 | @apply mb-6 text-4xl font-extrabold tracking-tight; 20 | } 21 | 22 | .markdown h2 { 23 | @apply mt-12 mb-4 text-3xl font-extrabold tracking-tight; 24 | } 25 | .markdown h3 { 26 | @apply mt-8 mb-3 text-2xl font-extrabold tracking-tight; 27 | } 28 | .markdown h4 { 29 | @apply mt-8 mb-3 text-xl font-extrabold tracking-tight; 30 | } 31 | 32 | .markdown code { 33 | @apply text-gray-70 bg-card dark:bg-card-dark p-1 rounded-lg no-underline; 34 | font-size: 90%; 35 | } 36 | 37 | .markdown li { 38 | @apply mb-2; 39 | } 40 | 41 | .markdown a { 42 | @apply inline text-link dark:text-link-dark break-normal border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal; 43 | } 44 | -------------------------------------------------------------------------------- /src/pages/404.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {Page} from 'components/Layout/Page'; 13 | import {MDXComponents} from 'components/MDX/MDXComponents'; 14 | import sidebarLearn from '../sidebarLearn.json'; 15 | 16 | const {Intro, MaxWidth, p: P, a: A} = MDXComponents; 17 | 18 | export default function NotFound() { 19 | return ( 20 | 21 | 22 | 23 |

This page doesn’t exist.

24 |

25 | If this is a mistake{', '} 26 | 27 | let us know 28 | 29 | {', '} 30 | and we will try to fix it! 31 |

32 |
33 |
34 |
35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /scripts/headingIdLinter.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | const validateHeaderIds = require('./headingIDHelpers/validateHeadingIDs'); 9 | const generateHeadingIds = require('./headingIDHelpers/generateHeadingIDs'); 10 | 11 | /** 12 | * yarn lint-heading-ids --> Checks all files and causes an error if heading ID is missing 13 | * yarn lint-heading-ids --fix --> Fixes all markdown file's heading IDs 14 | * yarn lint-heading-ids path/to/markdown.md --> Checks that particular file for missing heading ID (path can denote a directory or particular file) 15 | * yarn lint-heading-ids --fix path/to/markdown.md --> Fixes that particular file's markdown IDs (path can denote a directory or particular file) 16 | */ 17 | 18 | const markdownPaths = process.argv.slice(2); 19 | if (markdownPaths.includes('--fix')) { 20 | generateHeadingIds(markdownPaths.filter((path) => path !== '--fix')); 21 | } else { 22 | validateHeaderIds(markdownPaths); 23 | } 24 | -------------------------------------------------------------------------------- /src/components/Icon/IconFacebookCircle.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import type {SVGProps} from 'react'; 14 | 15 | export const IconFacebookCircle = memo>( 16 | function IconFacebookCircle(props) { 17 | return ( 18 | 25 | 26 | 27 | 28 | ); 29 | } 30 | ); 31 | -------------------------------------------------------------------------------- /src/pages/500.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {Page} from 'components/Layout/Page'; 13 | import {MDXComponents} from 'components/MDX/MDXComponents'; 14 | import sidebarLearn from '../sidebarLearn.json'; 15 | 16 | const {Intro, MaxWidth, p: P, a: A} = MDXComponents; 17 | 18 | export default function NotFound() { 19 | return ( 20 | 24 | 25 | 26 |

Something went very wrong.

27 |

Sorry about that.

28 |

29 | If you’d like, please{' '} 30 | 31 | report a bug. 32 | 33 |

34 |
35 |
36 |
37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/0-bug.yml: -------------------------------------------------------------------------------- 1 | name: "🐛 Report a bug" 2 | description: "Report a problem on the website." 3 | title: "[Bug]: " 4 | labels: ["bug: unconfirmed"] 5 | body: 6 | - type: textarea 7 | attributes: 8 | label: Summary 9 | description: | 10 | A clear and concise summary of what the bug is. 11 | placeholder: | 12 | Example bug report: 13 | When I click the "Submit" button on "Feedback", nothing happens. 14 | validations: 15 | required: true 16 | - type: input 17 | attributes: 18 | label: Page 19 | description: | 20 | What page(s) did you encounter this bug on? 21 | placeholder: | 22 | https://react.dev/ 23 | validations: 24 | required: true 25 | - type: textarea 26 | attributes: 27 | label: Details 28 | description: | 29 | Please provide any additional details about the bug. 30 | placeholder: | 31 | Example details: 32 | The "Submit" button is unresponsive. I've tried refreshing the page and using a different browser, but the issue persists. 33 | validations: 34 | required: false 35 | -------------------------------------------------------------------------------- /src/components/MDX/SimpleCallout.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | import cn from 'classnames'; 14 | import {H3} from './Heading'; 15 | 16 | interface SimpleCalloutProps { 17 | title: string; 18 | children: React.ReactNode; 19 | className?: string; 20 | } 21 | function SimpleCallout({title, children, className}: SimpleCalloutProps) { 22 | return ( 23 |
28 |

31 | {title} 32 |

33 | {children} 34 |
35 | ); 36 | } 37 | 38 | export default SimpleCallout; 39 | -------------------------------------------------------------------------------- /src/components/ErrorDecoderContext.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | // Error Decoder requires reading pregenerated error message from getStaticProps, 9 | // but MDX component doesn't support props. So we use React Context to populate 10 | // the value without prop-drilling. 11 | // TODO: Replace with React.cache + React.use when migrating to Next.js App Router 12 | 13 | import {createContext, useContext} from 'react'; 14 | 15 | const notInErrorDecoderContext = Symbol('not in error decoder context'); 16 | 17 | export const ErrorDecoderContext = createContext< 18 | | {errorMessage: string | null; errorCode: string | null} 19 | | typeof notInErrorDecoderContext 20 | >(notInErrorDecoderContext); 21 | 22 | export const useErrorDecoderParams = () => { 23 | const params = useContext(ErrorDecoderContext); 24 | 25 | if (params === notInErrorDecoderContext) { 26 | throw new Error('useErrorDecoder must be used in error decoder pages only'); 27 | } 28 | 29 | return params; 30 | }; 31 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/1-typo.yml: -------------------------------------------------------------------------------- 1 | name: "🤦 Typo or mistake" 2 | description: "Report a typo or mistake in the docs." 3 | title: "[Typo]: " 4 | labels: ["type: typos"] 5 | body: 6 | - type: textarea 7 | attributes: 8 | label: Summary 9 | description: | 10 | A clear and concise summary of what the mistake is. 11 | placeholder: | 12 | Example: 13 | The code example on the "useReducer" page includes an unused variable `nextId`. 14 | validations: 15 | required: true 16 | - type: input 17 | attributes: 18 | label: Page 19 | description: | 20 | What page is the typo on? 21 | placeholder: | 22 | https://react.dev/ 23 | validations: 24 | required: true 25 | - type: textarea 26 | attributes: 27 | label: Details 28 | description: | 29 | Please provide a explanation for why this is a mistake. 30 | placeholder: | 31 | Example mistake: 32 | In the "useReducer" section of the "API Reference" page, the code example under "Writing a reducer function" includes an unused variable `nextId` that should be removed. 33 | validations: 34 | required: false 35 | -------------------------------------------------------------------------------- /src/components/MDX/InlineCode.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import cn from 'classnames'; 13 | import type {HTMLAttributes} from 'react'; 14 | 15 | interface InlineCodeProps { 16 | isLink?: boolean; 17 | meta?: string; 18 | } 19 | function InlineCode({ 20 | isLink, 21 | ...props 22 | }: HTMLAttributes & InlineCodeProps) { 23 | return ( 24 | in case of RTL languages to avoid like `()console.log` to be rendered as `console.log()` 26 | className={cn( 27 | 'inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline', 28 | { 29 | 'bg-gray-30 bg-opacity-10 py-px': !isLink, 30 | 'bg-highlight dark:bg-highlight-dark py-0': isLink, 31 | } 32 | )} 33 | {...props} 34 | /> 35 | ); 36 | } 37 | 38 | export default InlineCode; 39 | -------------------------------------------------------------------------------- /src/content/learn/setup.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Setup 3 | --- 4 | 5 | 6 | React integrates with tools like editors, TypeScript, browser extensions, and compilers. This section will help you get your environment set up. 7 | 8 | 9 | 10 | ## Editor Setup {/*editor-setup*/} 11 | 12 | See our [recommended editors](/learn/editor-setup) and learn how to set them up to work with React. 13 | 14 | ## Using TypeScript {/*using-typescript*/} 15 | 16 | TypeScript is a popular way to add type definitions to JavaScript codebases. [Learn how to integrate TypeScript into your React projects](/learn/typescript). 17 | 18 | ## React Developer Tools {/*react-developer-tools*/} 19 | 20 | React Developer Tools is a browser extension that can inspect React components, edit props and state, and identify performance problems. Learn how to install it [here](learn/react-developer-tools). 21 | 22 | ## React Compiler {/*react-compiler*/} 23 | 24 | React Compiler is a tool that automatically optimizes your React app. [Learn more](/learn/react-compiler). 25 | 26 | ## Next steps {/*next-steps*/} 27 | 28 | Head to the [Quick Start](/learn) guide for a tour of the most important React concepts you will encounter every day. 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2-suggestion.yml: -------------------------------------------------------------------------------- 1 | name: "💡 Suggestions" 2 | description: "Suggest a new page, section, or edit for an existing page." 3 | title: "[Suggestion]: " 4 | labels: ["type: documentation"] 5 | body: 6 | - type: textarea 7 | attributes: 8 | label: Summary 9 | description: | 10 | A clear and concise summary of what we should add. 11 | placeholder: | 12 | Example: 13 | Add a new page for how to use React with TypeScript. 14 | validations: 15 | required: true 16 | - type: input 17 | attributes: 18 | label: Page 19 | description: | 20 | What page is this about? 21 | placeholder: | 22 | https://react.dev/ 23 | validations: 24 | required: false 25 | - type: textarea 26 | attributes: 27 | label: Details 28 | description: | 29 | Please provide a explanation for what you're suggesting. 30 | placeholder: | 31 | Example: 32 | I think it would be helpful to have a page that explains how to use React with TypeScript. This could include a basic example of a component written in TypeScript, and a link to the TypeScript documentation. 33 | validations: 34 | required: true 35 | -------------------------------------------------------------------------------- /src/components/MDX/Sandpack/OpenInTypeScriptPlayground.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {IconNewPage} from '../../Icon/IconNewPage'; 13 | 14 | export const OpenInTypeScriptPlaygroundButton = (props: {content: string}) => { 15 | const contentWithReactImport = `import * as React from 'react';\n\n${props.content}`; 16 | return ( 17 | 25 | 30 | TypeScript Playground 31 | 32 | ); 33 | }; 34 | -------------------------------------------------------------------------------- /src/components/Icon/IconGitHub.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import type {SVGProps} from 'react'; 14 | 15 | export const IconGitHub = memo>(function IconGitHub( 16 | props 17 | ) { 18 | return ( 19 | 26 | 27 | 28 | ); 29 | }); 30 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "extends": "next/core-web-vitals", 4 | "parser": "@typescript-eslint/parser", 5 | "plugins": ["@typescript-eslint", "eslint-plugin-react-compiler", "local-rules"], 6 | "rules": { 7 | "no-unused-vars": "off", 8 | "@typescript-eslint/no-unused-vars": ["error", {"varsIgnorePattern": "^_"}], 9 | "react-hooks/exhaustive-deps": "error", 10 | "react/no-unknown-property": ["error", {"ignore": ["meta"]}], 11 | "react-compiler/react-compiler": "error", 12 | "local-rules/lint-markdown-code-blocks": "error" 13 | }, 14 | "env": { 15 | "node": true, 16 | "commonjs": true, 17 | "browser": true, 18 | "es6": true 19 | }, 20 | "overrides": [ 21 | { 22 | "files": ["src/content/**/*.md"], 23 | "parser": "./eslint-local-rules/parser", 24 | "parserOptions": { 25 | "sourceType": "module" 26 | }, 27 | "rules": { 28 | "no-unused-vars": "off", 29 | "@typescript-eslint/no-unused-vars": "off", 30 | "react-hooks/exhaustive-deps": "off", 31 | "react/no-unknown-property": "off", 32 | "react-compiler/react-compiler": "off", 33 | "local-rules/lint-markdown-code-blocks": "error" 34 | } 35 | } 36 | ] 37 | } 38 | -------------------------------------------------------------------------------- /src/components/Icon/IconBsky.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import type {SVGProps} from 'react'; 14 | 15 | export const IconBsky = memo>(function IconBsky(props) { 16 | return ( 17 | 25 | 28 | 29 | ); 30 | }); 31 | -------------------------------------------------------------------------------- /plugins/markdownToHtml.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | const remark = require('remark'); 9 | const externalLinks = require('remark-external-links'); // Add _target and rel to external links 10 | const customHeaders = require('./remark-header-custom-ids'); // Custom header id's for i18n 11 | const images = require('remark-images'); // Improved image syntax 12 | const unrwapImages = require('remark-unwrap-images'); // Removes

wrapper around images 13 | const smartyPants = require('./remark-smartypants'); // Cleans up typography 14 | const html = require('remark-html'); 15 | 16 | module.exports = { 17 | remarkPlugins: [ 18 | externalLinks, 19 | customHeaders, 20 | images, 21 | unrwapImages, 22 | smartyPants, 23 | ], 24 | markdownToHtml, 25 | }; 26 | 27 | async function markdownToHtml(markdown) { 28 | const result = await remark() 29 | .use(externalLinks) 30 | .use(customHeaders) 31 | .use(images) 32 | .use(unrwapImages) 33 | .use(smartyPants) 34 | .use(html) 35 | .process(markdown); 36 | return result.toString(); 37 | } 38 | -------------------------------------------------------------------------------- /src/utils/toCommaSeparatedList.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | 14 | const addString = (list: React.ReactNode[], string: string) => 15 | list.push({string}); 16 | 17 | function toCommaSeparatedList( 18 | array: Item[], 19 | renderCallback: (item: Item, index: number) => React.ReactNode 20 | ): React.ReactNode[] { 21 | if (array.length <= 1) { 22 | return array.map(renderCallback); 23 | } 24 | 25 | const list: React.ReactNode[] = []; 26 | 27 | array.forEach((item, index) => { 28 | if (index === array.length - 1) { 29 | addString(list, array.length === 2 ? ' and ' : ', and '); 30 | list.push(renderCallback(item, index)); 31 | } else if (index > 0) { 32 | addString(list, ', '); 33 | list.push(renderCallback(item, index)); 34 | } else { 35 | list.push(renderCallback(item, index)); 36 | } 37 | }); 38 | 39 | return list; 40 | } 41 | 42 | export default toCommaSeparatedList; 43 | -------------------------------------------------------------------------------- /src/content/warnings/react-test-renderer.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: react-test-renderer Deprecation Warnings 3 | --- 4 | 5 | ## ReactTestRenderer.create() warning {/*reacttestrenderercreate-warning*/} 6 | 7 | react-test-renderer is deprecated. A warning will fire whenever calling ReactTestRenderer.create() or ReactShallowRender.render(). The react-test-renderer package will remain available on NPM but will not be maintained and may break with new React features or changes to React's internals. 8 | 9 | The React Team recommends migrating your tests to [@testing-library/react](https://testing-library.com/docs/react-testing-library/intro/) or [@testing-library/react-native](https://callstack.github.io/react-native-testing-library/docs/start/intro) for a modern and well supported testing experience. 10 | 11 | 12 | ## new ShallowRenderer() warning {/*new-shallowrenderer-warning*/} 13 | 14 | The react-test-renderer package no longer exports a shallow renderer at `react-test-renderer/shallow`. This was simply a repackaging of a previously extracted separate package: `react-shallow-renderer`. Therefore you can continue using the shallow renderer in the same way by installing it directly. See [Github](https://github.com/enzymejs/react-shallow-renderer) / [NPM](https://www.npmjs.com/package/react-shallow-renderer). 15 | -------------------------------------------------------------------------------- /.github/workflows/discord_notify.yml: -------------------------------------------------------------------------------- 1 | name: Discord Notify 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened, ready_for_review] 6 | 7 | jobs: 8 | check_maintainer: 9 | uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main 10 | permissions: 11 | # Used by check_maintainer 12 | contents: read 13 | with: 14 | actor: ${{ github.event.pull_request.user.login }} 15 | 16 | notify: 17 | if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }} 18 | needs: check_maintainer 19 | runs-on: ubuntu-latest 20 | steps: 21 | - name: Discord Webhook Action 22 | uses: tsickert/discord-webhook@v6.0.0 23 | with: 24 | webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }} 25 | embed-author-name: ${{ github.event.pull_request.user.login }} 26 | embed-author-url: ${{ github.event.pull_request.user.html_url }} 27 | embed-author-icon-url: ${{ github.event.pull_request.user.avatar_url }} 28 | embed-title: '#${{ github.event.number }} (+${{github.event.pull_request.additions}} -${{github.event.pull_request.deletions}}): ${{ github.event.pull_request.title }}' 29 | embed-description: ${{ github.event.pull_request.body }} 30 | embed-url: ${{ github.event.pull_request.html_url }} 31 | -------------------------------------------------------------------------------- /src/sidebarCommunity.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "Community", 3 | "path": "/community", 4 | "routes": [ 5 | { 6 | "hasSectionHeader": true, 7 | "sectionHeader": "GET INVOLVED" 8 | }, 9 | { 10 | "title": "Community", 11 | "path": "/community", 12 | "skipBreadcrumb": true, 13 | "routes": [ 14 | { 15 | "title": "React Conferences", 16 | "path": "/community/conferences" 17 | }, 18 | { 19 | "title": "React Meetups", 20 | "path": "/community/meetups" 21 | }, 22 | { 23 | "title": "React Videos", 24 | "path": "/community/videos" 25 | }, 26 | { 27 | "title": "Meet the Team", 28 | "path": "/community/team" 29 | }, 30 | { 31 | "title": "Docs Contributors", 32 | "path": "/community/docs-contributors" 33 | }, 34 | { 35 | "title": "Translations", 36 | "path": "/community/translations" 37 | }, 38 | { 39 | "title": "Acknowledgements", 40 | "path": "/community/acknowledgements" 41 | }, 42 | { 43 | "title": "Versioning Policy", 44 | "path": "/community/versioning-policy" 45 | } 46 | ] 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /.github/workflows/label_core_team_prs.yml: -------------------------------------------------------------------------------- 1 | name: Label Core Team PRs 2 | 3 | on: 4 | pull_request: 5 | 6 | permissions: {} 7 | 8 | permissions: {} 9 | 10 | env: 11 | TZ: /usr/share/zoneinfo/America/Los_Angeles 12 | # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout 13 | SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 14 | 15 | jobs: 16 | check_maintainer: 17 | uses: facebook/react/.github/workflows/shared_check_maintainer.yml@main 18 | permissions: 19 | # Used by check_maintainer 20 | contents: read 21 | with: 22 | actor: ${{ github.event.pull_request.user.login }} 23 | 24 | label: 25 | if: ${{ needs.check_maintainer.outputs.is_core_team == 'true' }} 26 | runs-on: ubuntu-latest 27 | needs: check_maintainer 28 | permissions: 29 | # Used to add labels on issues 30 | issues: write 31 | # Used to add labels on PRs 32 | pull-requests: write 33 | steps: 34 | - name: Label PR as React Core Team 35 | uses: actions/github-script@v7 36 | with: 37 | script: | 38 | github.rest.issues.addLabels({ 39 | owner: context.repo.owner, 40 | repo: context.repo.repo, 41 | issue_number: ${{ github.event.number }}, 42 | labels: ['React Core Team'] 43 | }); 44 | -------------------------------------------------------------------------------- /public/images/home/conf2021/cover.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/components/Icon/IconTerminal.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | 14 | export const IconTerminal = memo( 15 | function IconTerminal({className}) { 16 | return ( 17 | 24 | 28 | 29 | ); 30 | } 31 | ); 32 | -------------------------------------------------------------------------------- /src/components/MDX/PackageImport.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {Children} from 'react'; 13 | import * as React from 'react'; 14 | import CodeBlock from './CodeBlock'; 15 | 16 | interface PackageImportProps { 17 | children: React.ReactNode; 18 | } 19 | 20 | export function PackageImport({children}: PackageImportProps) { 21 | const terminal = Children.toArray(children).filter((child: any) => { 22 | return child.type?.mdxName !== 'pre'; 23 | }); 24 | const code = Children.toArray(children).map((child: any, i: number) => { 25 | if (child.type?.mdxName === 'pre') { 26 | return ( 27 | 34 | ); 35 | } else { 36 | return null; 37 | } 38 | }); 39 | return ( 40 |

41 |
{terminal}
42 |
{code}
43 |
44 | ); 45 | } 46 | -------------------------------------------------------------------------------- /src/components/Icon/IconArrow.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import cn from 'classnames'; 14 | import type {SVGProps} from 'react'; 15 | 16 | export const IconArrow = memo< 17 | SVGProps & { 18 | /** 19 | * The direction the arrow should point. 20 | * `start` and `end` are relative to the current locale. 21 | * for example, in LTR, `start` is left and `end` is right. 22 | */ 23 | displayDirection: 'start' | 'end' | 'right' | 'left' | 'up' | 'down'; 24 | } 25 | >(function IconArrow({displayDirection, className, ...rest}) { 26 | return ( 27 | 38 | 39 | 40 | 41 | ); 42 | }); 43 | -------------------------------------------------------------------------------- /src/components/MDX/Sandpack/Themes.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import tailwindConfig from '../../../../tailwind.config'; 13 | 14 | export const CustomTheme = { 15 | colors: { 16 | accent: 'inherit', 17 | base: 'inherit', 18 | clickable: 'inherit', 19 | disabled: 'inherit', 20 | error: 'inherit', 21 | errorSurface: 'inherit', 22 | hover: 'inherit', 23 | surface1: 'inherit', 24 | surface2: 'inherit', 25 | surface3: 'inherit', 26 | warning: 'inherit', 27 | warningSurface: 'inherit', 28 | }, 29 | syntax: { 30 | plain: 'inherit', 31 | comment: 'inherit', 32 | keyword: 'inherit', 33 | tag: 'inherit', 34 | punctuation: 'inherit', 35 | definition: 'inherit', 36 | property: 'inherit', 37 | static: 'inherit', 38 | string: 'inherit', 39 | }, 40 | font: { 41 | body: tailwindConfig.theme.extend.fontFamily.text 42 | .join(', ') 43 | .replace(/"/gm, ''), 44 | mono: tailwindConfig.theme.extend.fontFamily.mono 45 | .join(', ') 46 | .replace(/"/gm, ''), 47 | size: tailwindConfig.theme.extend.fontSize.code, 48 | lineHeight: '24px', 49 | }, 50 | }; 51 | -------------------------------------------------------------------------------- /src/components/Icon/IconSolution.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import cn from 'classnames'; 14 | 15 | export const IconSolution = memo( 16 | function IconSolution({className}) { 17 | return ( 18 | 24 | 28 | 29 | ); 30 | } 31 | ); 32 | -------------------------------------------------------------------------------- /src/content/reference/react-dom/hooks/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Built-in React DOM Hooks" 3 | --- 4 | 5 | 6 | 7 | The `react-dom` package contains Hooks that are only supported for web applications (which run in the browser DOM environment). These Hooks are not supported in non-browser environments like iOS, Android, or Windows applications. If you are looking for Hooks that are supported in web browsers *and other environments* see [the React Hooks page](/reference/react/hooks). This page lists all the Hooks in the `react-dom` package. 8 | 9 | 10 | 11 | --- 12 | 13 | ## Form Hooks {/*form-hooks*/} 14 | 15 | *Forms* let you create interactive controls for submitting information. To manage forms in your components, use one of these Hooks: 16 | 17 | * [`useFormStatus`](/reference/react-dom/hooks/useFormStatus) allows you to make updates to the UI based on the status of a form. 18 | 19 | ```js 20 | function Form({ action }) { 21 | async function increment(n) { 22 | return n + 1; 23 | } 24 | const [count, incrementFormAction] = useActionState(increment, 0); 25 | return ( 26 |
27 | 28 |
39 | ); 40 | } 41 | ``` 42 | -------------------------------------------------------------------------------- /src/components/MDX/YouWillLearnCard.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | import ButtonLink from 'components/ButtonLink'; 14 | import {IconNavArrow} from 'components/Icon/IconNavArrow'; 15 | 16 | interface YouWillLearnCardProps { 17 | title: string; 18 | path: string; 19 | children: React.ReactNode; 20 | } 21 | 22 | function YouWillLearnCard({title, path, children}: YouWillLearnCardProps) { 23 | return ( 24 |
25 |
26 |

27 | {title} 28 |

29 |
{children}
30 |
31 |
32 | 38 | Read More 39 | 40 | 41 |
42 |
43 | ); 44 | } 45 | 46 | export default YouWillLearnCard; 47 | -------------------------------------------------------------------------------- /public/html/single-file-example.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Hello World 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 22 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/components/Tag.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import cn from 'classnames'; 13 | import type {RouteTag} from './Layout/getRouteMeta'; 14 | 15 | const variantMap = { 16 | foundation: { 17 | name: 'Foundation', 18 | classes: 'bg-yellow-50 text-white', 19 | }, 20 | intermediate: { 21 | name: 'Intermediate', 22 | classes: 'bg-purple-40 text-white', 23 | }, 24 | advanced: { 25 | name: 'Advanced', 26 | classes: 'bg-green-40 text-white', 27 | }, 28 | experimental: { 29 | name: 'Experimental', 30 | classes: 'bg-ui-orange text-white', 31 | }, 32 | deprecated: { 33 | name: 'Deprecated', 34 | classes: 'bg-red-40 text-white', 35 | }, 36 | }; 37 | 38 | interface TagProps { 39 | variant: RouteTag; 40 | text?: string; 41 | className?: string; 42 | } 43 | 44 | function Tag({text, variant, className}: TagProps) { 45 | const {name, classes} = variantMap[variant]; 46 | return ( 47 | 48 | 53 | {text || name} 54 | 55 | 56 | ); 57 | } 58 | 59 | export default Tag; 60 | -------------------------------------------------------------------------------- /src/components/MDX/CodeBlock/index.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | import cn from 'classnames'; 14 | import {lazy, memo, Suspense} from 'react'; 15 | const CodeBlock = lazy(() => import('./CodeBlock')); 16 | 17 | export default memo(function CodeBlockWrapper(props: { 18 | children: React.ReactNode & { 19 | props: { 20 | className: string; 21 | children: string; 22 | meta?: string; 23 | }; 24 | }; 25 | isFromPackageImport: boolean; 26 | noMargin?: boolean; 27 | noMarkers?: boolean; 28 | }): any { 29 | const {children, isFromPackageImport} = props; 30 | return ( 31 | 40 |
41 |

{children}

42 |
43 | 44 | }> 45 | 46 |
47 | ); 48 | }); 49 | -------------------------------------------------------------------------------- /src/content/community/translations.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Translations 3 | --- 4 | 5 | 6 | 7 | React docs are translated by the global community into many languages all over the world. 8 | 9 | 10 | 11 | ## Source site {/*main-site*/} 12 | 13 | All translations are provided from the canonical source docs: 14 | 15 | - [English](https://react.dev/) — [Contribute](https://github.com/reactjs/react.dev/) 16 | 17 | ## Full translations {/*full-translations*/} 18 | 19 | {/* If you are a language maintainer and want to add your language here, finish the "Core" translations and edit `deployedTranslations` under `src/utils`. */} 20 | 21 | 22 | 23 | ## In-progress translations {/*in-progress-translations*/} 24 | 25 | For the progress of each translation, see: [Is React Translated Yet?](https://translations.react.dev/) 26 | 27 | 28 | 29 | ## How to contribute {/*how-to-contribute*/} 30 | 31 | You can contribute to the translation efforts! 32 | 33 | The community conducts the translation work for the React docs on each language-specific fork of react.dev. Typical translation work involves directly translating a Markdown file and creating a pull request. Click the "contribute" link above to the GitHub repository for your language, and follow the instructions there to help with the translation effort. 34 | 35 | If you want to start a new translation for your language, visit: [translations.react.dev](https://github.com/reactjs/translations.react.dev) -------------------------------------------------------------------------------- /src/components/Icon/IconWarning.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | 14 | export const IconWarning = memo( 15 | function IconWarning({className}) { 16 | return ( 17 | 23 | 24 | 30 | 31 | 32 | ); 33 | } 34 | ); 35 | -------------------------------------------------------------------------------- /src/hooks/usePendingRoute.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {useRouter} from 'next/router'; 13 | import {useState, useRef, useEffect} from 'react'; 14 | 15 | const usePendingRoute = () => { 16 | const {events} = useRouter(); 17 | const [pendingRoute, setPendingRoute] = useState(null); 18 | const currentRoute = useRef(null); 19 | useEffect(() => { 20 | let routeTransitionTimer: any = null; 21 | 22 | const handleRouteChangeStart = (url: string) => { 23 | clearTimeout(routeTransitionTimer); 24 | routeTransitionTimer = setTimeout(() => { 25 | if (currentRoute.current !== url) { 26 | currentRoute.current = url; 27 | setPendingRoute(url); 28 | } 29 | }, 100); 30 | }; 31 | const handleRouteChangeComplete = () => { 32 | setPendingRoute(null); 33 | clearTimeout(routeTransitionTimer); 34 | }; 35 | events.on('routeChangeStart', handleRouteChangeStart); 36 | events.on('routeChangeComplete', handleRouteChangeComplete); 37 | 38 | return () => { 39 | events.off('routeChangeStart', handleRouteChangeStart); 40 | events.off('routeChangeComplete', handleRouteChangeComplete); 41 | clearTimeout(routeTransitionTimer); 42 | }; 43 | }, [events]); 44 | 45 | return pendingRoute; 46 | }; 47 | 48 | export default usePendingRoute; 49 | -------------------------------------------------------------------------------- /src/components/MDX/Sandpack/template.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | export const template = { 9 | '/src/index.js': { 10 | hidden: true, 11 | code: `import { StrictMode } from "react"; 12 | import { createRoot } from "react-dom/client"; 13 | import "./styles.css"; 14 | 15 | import App from "./App"; 16 | 17 | const root = createRoot(document.getElementById("root")); 18 | root.render( 19 | 20 | 21 | 22 | );`, 23 | }, 24 | '/package.json': { 25 | hidden: true, 26 | code: JSON.stringify( 27 | { 28 | name: 'react.dev', 29 | version: '0.0.0', 30 | main: '/src/index.js', 31 | scripts: { 32 | start: 'react-scripts start', 33 | build: 'react-scripts build', 34 | test: 'react-scripts test --env=jsdom', 35 | eject: 'react-scripts eject', 36 | }, 37 | dependencies: { 38 | react: '^19.2.1', 39 | 'react-dom': '^19.2.1', 40 | 'react-scripts': '^5.0.0', 41 | }, 42 | }, 43 | null, 44 | 2 45 | ), 46 | }, 47 | '/public/index.html': { 48 | hidden: true, 49 | code: ` 50 | 51 | 52 | 53 | 54 | Document 55 | 56 | 57 |
58 | 59 | `, 60 | }, 61 | }; 62 | -------------------------------------------------------------------------------- /src/components/MDX/CodeDiagram.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {Children} from 'react'; 13 | import * as React from 'react'; 14 | import CodeBlock from './CodeBlock'; 15 | 16 | interface CodeDiagramProps { 17 | children: React.ReactNode; 18 | flip?: boolean; 19 | } 20 | 21 | export function CodeDiagram({children, flip = false}: CodeDiagramProps) { 22 | const illustration = Children.toArray(children).filter((child: any) => { 23 | return child.type === 'img'; 24 | }); 25 | const content = Children.toArray(children).map((child: any) => { 26 | if (child.type?.mdxName === 'pre') { 27 | return ( 28 | 34 | ); 35 | } else if (child.type === 'img') { 36 | return null; 37 | } else { 38 | return child; 39 | } 40 | }); 41 | if (flip) { 42 | return ( 43 |
44 | {illustration} 45 |
{content}
46 |
47 | ); 48 | } 49 | return ( 50 |
51 |
{content}
52 |
{illustration}
53 |
54 | ); 55 | } 56 | -------------------------------------------------------------------------------- /src/components/Button.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import * as React from 'react'; 13 | import cn from 'classnames'; 14 | 15 | interface ButtonProps { 16 | children: React.ReactNode; 17 | onClick?: (event: React.MouseEvent) => void; 18 | active?: boolean; 19 | className?: string; 20 | style?: Record; 21 | } 22 | 23 | export function Button({ 24 | children, 25 | onClick, 26 | active = false, 27 | className, 28 | style, 29 | }: ButtonProps) { 30 | return ( 31 | 50 | ); 51 | } 52 | 53 | export default Button; 54 | -------------------------------------------------------------------------------- /src/components/MDX/Sandpack/useSandpackLint.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | // @ts-nocheck 13 | 14 | import {useState, useEffect} from 'react'; 15 | import type {EditorView} from '@codemirror/view'; 16 | 17 | export type LintDiagnostic = { 18 | line: number; 19 | column: number; 20 | severity: 'warning' | 'error'; 21 | message: string; 22 | }[]; 23 | 24 | export const useSandpackLint = () => { 25 | const [lintErrors, setLintErrors] = useState([]); 26 | const [lintExtensions, setLintExtensions] = useState([]); 27 | useEffect(() => { 28 | const loadLinter = async () => { 29 | const {linter} = await import('@codemirror/lint'); 30 | const onLint = linter(async (props: EditorView) => { 31 | // This is intentionally delayed until CodeMirror calls it 32 | // so that we don't take away bandwidth from things loading early. 33 | const {runESLint} = await import('./runESLint'); 34 | const editorState = props.state.doc; 35 | let {errors, codeMirrorErrors} = runESLint(editorState); 36 | // Ignore parsing or internal linter errors. 37 | const isReactRuleError = (error: any) => error.ruleId != null; 38 | setLintErrors(errors.filter(isReactRuleError)); 39 | return codeMirrorErrors.filter(isReactRuleError); 40 | }); 41 | setLintExtensions([onLint]); 42 | }; 43 | 44 | loadLinter(); 45 | }, []); 46 | return {lintErrors, lintExtensions}; 47 | }; 48 | -------------------------------------------------------------------------------- /src/components/Icon/IconNote.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | 14 | export const IconNote = memo(function IconNote({ 15 | className, 16 | }) { 17 | return ( 18 | 25 | 26 | 30 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | ); 48 | }); 49 | -------------------------------------------------------------------------------- /src/components/Icon/IconArrowSmall.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import cn from 'classnames'; 14 | import type {SVGProps} from 'react'; 15 | 16 | export const IconArrowSmall = memo< 17 | SVGProps & { 18 | /** 19 | * The direction the arrow should point. 20 | * `start` and `end` are relative to the current locale. 21 | * for example, in LTR, `start` is left and `end` is right. 22 | */ 23 | displayDirection: 'start' | 'end' | 'right' | 'left' | 'up' | 'down'; 24 | } 25 | >(function IconArrowSmall({displayDirection, className, ...rest}) { 26 | const classes = cn(className, { 27 | 'rotate-180': displayDirection === 'left', 28 | 'rotate-180 rtl:rotate-0': displayDirection === 'start', 29 | 'rtl:rotate-180': displayDirection === 'end', 30 | 'rotate-90': displayDirection === 'down', 31 | }); 32 | return ( 33 | 41 | 44 | 45 | ); 46 | }); 47 | -------------------------------------------------------------------------------- /src/content/reference/eslint-plugin-react-hooks/lints/gating.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: gating 3 | --- 4 | 5 | 6 | 7 | Validates configuration of [gating mode](/reference/react-compiler/gating). 8 | 9 | 10 | 11 | ## Rule Details {/*rule-details*/} 12 | 13 | Gating mode lets you gradually adopt React Compiler by marking specific components for optimization. This rule ensures your gating configuration is valid so the compiler knows which components to process. 14 | 15 | ### Invalid {/*invalid*/} 16 | 17 | Examples of incorrect code for this rule: 18 | 19 | ```js 20 | // ❌ Missing required fields 21 | module.exports = { 22 | plugins: [ 23 | ['babel-plugin-react-compiler', { 24 | gating: { 25 | importSpecifierName: '__experimental_useCompiler' 26 | // Missing 'source' field 27 | } 28 | }] 29 | ] 30 | }; 31 | 32 | // ❌ Invalid gating type 33 | module.exports = { 34 | plugins: [ 35 | ['babel-plugin-react-compiler', { 36 | gating: '__experimental_useCompiler' // Should be object 37 | }] 38 | ] 39 | }; 40 | ``` 41 | 42 | ### Valid {/*valid*/} 43 | 44 | Examples of correct code for this rule: 45 | 46 | ```js 47 | // ✅ Complete gating configuration 48 | module.exports = { 49 | plugins: [ 50 | ['babel-plugin-react-compiler', { 51 | gating: { 52 | importSpecifierName: 'isCompilerEnabled', // exported function name 53 | source: 'featureFlags' // module name 54 | } 55 | }] 56 | ] 57 | }; 58 | 59 | // featureFlags.js 60 | export function isCompilerEnabled() { 61 | // ... 62 | } 63 | 64 | // ✅ No gating (compile everything) 65 | module.exports = { 66 | plugins: [ 67 | ['babel-plugin-react-compiler', { 68 | // No gating field - compiles all components 69 | }] 70 | ] 71 | }; 72 | ``` 73 | -------------------------------------------------------------------------------- /src/components/SocialBanner.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | import {useRef, useEffect} from 'react'; 9 | import cn from 'classnames'; 10 | import {ExternalLink} from './ExternalLink'; 11 | 12 | const bannerText = 'Join us for React Conf on Oct 7-8.'; 13 | const bannerLink = 'https://conf.react.dev/'; 14 | const bannerLinkText = 'Learn more.'; 15 | 16 | export default function SocialBanner() { 17 | const ref = useRef(null); 18 | useEffect(() => { 19 | function patchedScrollTo(x: number, y: number) { 20 | if (y === 0) { 21 | // We're trying to reset scroll. 22 | // If we already scrolled past the banner, consider it as y = 0. 23 | const bannerHeight = ref.current?.offsetHeight ?? 0; // Could be zero (e.g. mobile) 24 | y = Math.min(window.scrollY, bannerHeight); 25 | } 26 | return realScrollTo(x, y); 27 | } 28 | const realScrollTo = window.scrollTo; 29 | (window as any).scrollTo = patchedScrollTo; 30 | return () => { 31 | (window as any).scrollTo = realScrollTo; 32 | }; 33 | }, []); 34 | return ( 35 | 47 | ); 48 | } 49 | -------------------------------------------------------------------------------- /src/content/learn/react-compiler/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: React Compiler 3 | --- 4 | 5 | ## Introduction {/*introduction*/} 6 | 7 | Learn [what React Compiler does](/learn/react-compiler/introduction) and how it automatically optimizes your React application by handling memoization for you, eliminating the need for manual `useMemo`, `useCallback`, and `React.memo`. 8 | 9 | ## Installation {/*installation*/} 10 | 11 | Get started with [installing React Compiler](/learn/react-compiler/installation) and learn how to configure it with your build tools. 12 | 13 | 14 | ## Incremental Adoption {/*incremental-adoption*/} 15 | 16 | Learn [strategies for gradually adopting React Compiler](/learn/react-compiler/incremental-adoption) in your existing codebase if you're not ready to enable it everywhere yet. 17 | 18 | ## Debugging and Troubleshooting {/*debugging-and-troubleshooting*/} 19 | 20 | When things don't work as expected, use our [debugging guide](/learn/react-compiler/debugging) to understand the difference between compiler errors and runtime issues, identify common breaking patterns, and follow a systematic debugging workflow. 21 | 22 | ## Configuration and Reference {/*configuration-and-reference*/} 23 | 24 | For detailed configuration options and API reference: 25 | 26 | - [Configuration Options](/reference/react-compiler/configuration) - All compiler configuration options including React version compatibility 27 | - [Directives](/reference/react-compiler/directives) - Function-level compilation control 28 | - [Compiling Libraries](/reference/react-compiler/compiling-libraries) - Shipping pre-compiled libraries 29 | 30 | ## Additional resources {/*additional-resources*/} 31 | 32 | In addition to these docs, we recommend checking the [React Compiler Working Group](https://github.com/reactwg/react-compiler) for additional information and discussion about the compiler. 33 | 34 | -------------------------------------------------------------------------------- /src/content/reference/react/apis.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Built-in React APIs" 3 | --- 4 | 5 | 6 | 7 | In addition to [Hooks](/reference/react/hooks) and [Components](/reference/react/components), the `react` package exports a few other APIs that are useful for defining components. This page lists all the remaining modern React APIs. 8 | 9 | 10 | 11 | --- 12 | 13 | * [`createContext`](/reference/react/createContext) lets you define and provide context to the child components. Used with [`useContext`.](/reference/react/useContext) 14 | * [`lazy`](/reference/react/lazy) lets you defer loading a component's code until it's rendered for the first time. 15 | * [`memo`](/reference/react/memo) lets your component skip re-renders with same props. Used with [`useMemo`](/reference/react/useMemo) and [`useCallback`.](/reference/react/useCallback) 16 | * [`startTransition`](/reference/react/startTransition) lets you mark a state update as non-urgent. Similar to [`useTransition`.](/reference/react/useTransition) 17 | * [`act`](/reference/react/act) lets you wrap renders and interactions in tests to ensure updates have processed before making assertions. 18 | 19 | --- 20 | 21 | ## Resource APIs {/*resource-apis*/} 22 | 23 | *Resources* can be accessed by a component without having them as part of their state. For example, a component can read a message from a Promise or read styling information from a context. 24 | 25 | To read a value from a resource, use this API: 26 | 27 | * [`use`](/reference/react/use) lets you read the value of a resource like a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) or [context](/learn/passing-data-deeply-with-context). 28 | ```js 29 | function MessageComponent({ messagePromise }) { 30 | const message = use(messagePromise); 31 | const theme = use(ThemeContext); 32 | // ... 33 | } 34 | ``` 35 | -------------------------------------------------------------------------------- /src/components/ButtonLink.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import cn from 'classnames'; 13 | import NextLink from 'next/link'; 14 | 15 | interface ButtonLinkProps { 16 | size?: 'md' | 'lg'; 17 | type?: 'primary' | 'secondary'; 18 | label?: string; 19 | target?: '_self' | '_blank'; 20 | } 21 | 22 | function ButtonLink({ 23 | href, 24 | className, 25 | children, 26 | type = 'primary', 27 | size = 'md', 28 | label, 29 | target = '_self', 30 | ...props 31 | }: React.AnchorHTMLAttributes & ButtonLinkProps) { 32 | const classes = cn( 33 | className, 34 | 'active:scale-[.98] transition-transform inline-flex font-bold items-center outline-none focus:outline-none focus-visible:outline focus-visible:outline-link focus:outline-offset-2 focus-visible:dark:focus:outline-link-dark leading-snug', 35 | { 36 | 'bg-link text-white dark:bg-brand-dark dark:text-secondary hover:bg-opacity-80': 37 | type === 'primary', 38 | 'text-primary dark:text-primary-dark shadow-secondary-button-stroke dark:shadow-secondary-button-stroke-dark hover:bg-gray-40/5 active:bg-gray-40/10 hover:dark:bg-gray-60/5 active:dark:bg-gray-60/10': 39 | type === 'secondary', 40 | 'text-lg py-3 rounded-full px-4 sm:px-6': size === 'lg', 41 | 'text-base rounded-full px-4 py-2': size === 'md', 42 | } 43 | ); 44 | return ( 45 | 51 | {children} 52 | 53 | ); 54 | } 55 | 56 | export default ButtonLink; 57 | -------------------------------------------------------------------------------- /src/components/MDX/Diagram.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import Image from 'next/image'; 13 | 14 | interface DiagramProps { 15 | name: string; 16 | alt: string; 17 | height: number; 18 | width: number; 19 | children: string; 20 | captionPosition: 'top' | 'bottom' | null; 21 | } 22 | 23 | function Caption({text}: {text: string}) { 24 | return ( 25 |
26 |
27 | {text} 28 |
29 |
30 | ); 31 | } 32 | 33 | export function Diagram({ 34 | name, 35 | alt, 36 | height, 37 | width, 38 | children, 39 | captionPosition, 40 | }: DiagramProps) { 41 | return ( 42 |
43 | {captionPosition === 'top' && } 44 |
45 | {alt} 51 |
52 |
53 | {alt} 59 |
60 | {(!captionPosition || captionPosition === 'bottom') && ( 61 | 62 | )} 63 |
64 | ); 65 | } 66 | 67 | export default Diagram; 68 | -------------------------------------------------------------------------------- /src/content/community/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: React Community 3 | --- 4 | 5 | 6 | 7 | React has a community of millions of developers. On this page we've listed some React-related communities that you can be a part of; see the other pages in this section for additional online and in-person learning materials. 8 | 9 | 10 | 11 | ## Code of Conduct {/*code-of-conduct*/} 12 | 13 | Before participating in React's communities, [please read our Code of Conduct.](https://github.com/facebook/react/blob/main/CODE_OF_CONDUCT.md) We have adopted the [Contributor Covenant](https://www.contributor-covenant.org/) and we expect that all community members adhere to the guidelines within. 14 | 15 | ## Stack Overflow {/*stack-overflow*/} 16 | 17 | Stack Overflow is a popular forum to ask code-level questions or if you're stuck with a specific error. Read through the [existing questions](https://stackoverflow.com/questions/tagged/reactjs) tagged with **reactjs** or [ask your own](https://stackoverflow.com/questions/ask?tags=reactjs)! 18 | 19 | ## Popular Discussion Forums {/*popular-discussion-forums*/} 20 | 21 | There are many online forums which are a great place for discussion about best practices and application architecture as well as the future of React. If you have an answerable code-level question, Stack Overflow is usually a better fit. 22 | 23 | Each community consists of many thousands of React users. 24 | 25 | * [DEV's React community](https://dev.to/t/react) 26 | * [Hashnode's React community](https://hashnode.com/n/reactjs) 27 | * [Reactiflux online chat](https://discord.gg/reactiflux) 28 | * [Reddit's React community](https://www.reddit.com/r/reactjs/) 29 | 30 | ## News {/*news*/} 31 | 32 | For the latest news about React, [follow **@reactjs** on Twitter](https://twitter.com/reactjs), [**@react.dev** on Bluesky](https://bsky.app/profile/react.dev) and the [official React blog](/blog/) on this website. 33 | -------------------------------------------------------------------------------- /scripts/headingIDHelpers/validateHeadingIDs.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | const fs = require('fs'); 9 | const walk = require('./walk'); 10 | 11 | /** 12 | * Validate if there is a custom heading id and exit if there isn't a heading 13 | * @param {string} line 14 | * @returns 15 | */ 16 | function validateHeaderId(line) { 17 | if (!line.startsWith('#')) { 18 | return; 19 | } 20 | 21 | const match = /\{\/\*(.*?)\*\/}/.exec(line); 22 | const id = match; 23 | if (!id) { 24 | console.error('Run yarn fix-headings to generate headings.'); 25 | process.exit(1); 26 | } 27 | } 28 | 29 | /** 30 | * Loops through the lines to skip code blocks 31 | * @param {Array} lines 32 | */ 33 | function validateHeaderIds(lines) { 34 | let inCode = false; 35 | const results = []; 36 | lines.forEach((line) => { 37 | // Ignore code blocks 38 | if (line.startsWith('```')) { 39 | inCode = !inCode; 40 | 41 | results.push(line); 42 | return; 43 | } 44 | if (inCode) { 45 | results.push(line); 46 | return; 47 | } 48 | validateHeaderId(line); 49 | }); 50 | } 51 | /** 52 | * paths are basically array of path for which we have to validate heading IDs 53 | * @param {Array} paths 54 | */ 55 | async function main(paths) { 56 | paths = paths.length === 0 ? ['src/content'] : paths; 57 | const files = paths.map((path) => [...walk(path)]).flat(); 58 | 59 | files.forEach((file) => { 60 | if (!(file.endsWith('.md') || file.endsWith('.mdx'))) { 61 | return; 62 | } 63 | 64 | const content = fs.readFileSync(file, 'utf8'); 65 | const lines = content.split('\n'); 66 | validateHeaderIds(lines); 67 | }); 68 | } 69 | 70 | module.exports = main; 71 | -------------------------------------------------------------------------------- /src/components/MDX/Link.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {Children, cloneElement} from 'react'; 13 | import NextLink from 'next/link'; 14 | import cn from 'classnames'; 15 | 16 | import {ExternalLink} from 'components/ExternalLink'; 17 | 18 | function Link({ 19 | href, 20 | className, 21 | children, 22 | ...props 23 | }: React.AnchorHTMLAttributes) { 24 | const classes = 25 | 'inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal'; 26 | const modifiedChildren = Children.toArray(children).map((child: any) => { 27 | if (child.type?.mdxName && child.type?.mdxName === 'inlineCode') { 28 | return cloneElement(child, { 29 | isLink: true, 30 | }); 31 | } 32 | return child; 33 | }); 34 | 35 | if (!href) { 36 | // eslint-disable-next-line jsx-a11y/anchor-has-content 37 | return ; 38 | } 39 | return ( 40 | <> 41 | {href.startsWith('https://') ? ( 42 | 43 | {modifiedChildren} 44 | 45 | ) : href.startsWith('#') ? ( 46 | // eslint-disable-next-line jsx-a11y/anchor-has-content 47 | 48 | {modifiedChildren} 49 | 50 | ) : ( 51 | 52 | {modifiedChildren} 53 | 54 | )} 55 | 56 | ); 57 | } 58 | 59 | export default Link; 60 | -------------------------------------------------------------------------------- /src/content/reference/react-dom/static/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Static React DOM APIs 3 | --- 4 | 5 | 6 | 7 | The `react-dom/static` APIs let you generate static HTML for React components. They have limited functionality compared to the streaming APIs. A [framework](/learn/creating-a-react-app#full-stack-frameworks) may call them for you. Most of your components don't need to import or use them. 8 | 9 | 10 | 11 | --- 12 | 13 | ## Static APIs for Web Streams {/*static-apis-for-web-streams*/} 14 | 15 | These methods are only available in the environments with [Web Streams](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API), which includes browsers, Deno, and some modern edge runtimes: 16 | 17 | * [`prerender`](/reference/react-dom/static/prerender) renders a React tree to static HTML with a [Readable Web Stream.](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) 18 | * [`resumeAndPrerender`](/reference/react-dom/static/resumeAndPrerender) continues a prerendered React tree to static HTML with a [Readable Web Stream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream). 19 | 20 | Node.js also includes these methods for compatibility, but they are not recommended due to worse performance. Use the [dedicated Node.js APIs](#static-apis-for-nodejs-streams) instead. 21 | 22 | --- 23 | 24 | ## Static APIs for Node.js Streams {/*static-apis-for-nodejs-streams*/} 25 | 26 | These methods are only available in the environments with [Node.js Streams](https://nodejs.org/api/stream.html): 27 | 28 | * [`prerenderToNodeStream`](/reference/react-dom/static/prerenderToNodeStream) renders a React tree to static HTML with a [Node.js Stream.](https://nodejs.org/api/stream.html) 29 | * [`resumeAndPrerenderToNodeStream`](/reference/react-dom/static/resumeAndPrerenderToNodeStream) continues a prerendered React tree to static HTML with a [Node.js Stream.](https://nodejs.org/api/stream.html) 30 | 31 | -------------------------------------------------------------------------------- /src/content/blog/2020/12/21/data-fetching-with-react-server-components.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Introducing Zero-Bundle-Size React Server Components" 3 | author: Dan Abramov, Lauren Tan, Joseph Savona, and Sebastian Markbage 4 | date: 2020/12/21 5 | description: 2020 has been a long year. As it comes to an end we wanted to share a special Holiday Update on our research into zero-bundle-size React Server Components. 6 | --- 7 | 8 | December 21, 2020 by [Dan Abramov](https://bsky.app/profile/danabra.mov), [Lauren Tan](https://twitter.com/potetotes), [Joseph Savona](https://twitter.com/en_JS), and [Sebastian Markbåge](https://twitter.com/sebmarkbage) 9 | 10 | --- 11 | 12 | 13 | 14 | 2020 has been a long year. As it comes to an end we wanted to share a special Holiday Update on our research into zero-bundle-size **React Server Components**. 15 | 16 | 17 | 18 | --- 19 | 20 | To introduce React Server Components, we have prepared a talk and a demo. If you want, you can check them out during the holidays, or later when work picks back up in the new year. 21 | 22 | 23 | 24 | **React Server Components are still in research and development.** We are sharing this work in the spirit of transparency and to get initial feedback from the React community. There will be plenty of time for that, so **don't feel like you have to catch up right now!** 25 | 26 | If you want to check them out, we recommend going in the following order: 27 | 28 | 1. **Watch the talk** to learn about React Server Components and see the demo. 29 | 30 | 2. **[Clone the demo](http://github.com/reactjs/server-components-demo)** to play with React Server Components on your computer. 31 | 32 | 3. **[Read the RFC (with FAQ at the end)](https://github.com/reactjs/rfcs/pull/188)** for a deeper technical breakdown and to provide feedback. 33 | 34 | We are excited to hear from you on the RFC or in replies to the [@reactjs](https://twitter.com/reactjs) Twitter handle. Happy holidays, stay safe, and see you next year! 35 | -------------------------------------------------------------------------------- /src/components/Breadcrumbs.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {Fragment} from 'react'; 13 | import Link from 'next/link'; 14 | import type {RouteItem} from 'components/Layout/getRouteMeta'; 15 | 16 | function Breadcrumbs({breadcrumbs}: {breadcrumbs: RouteItem[]}) { 17 | return ( 18 |
19 | {breadcrumbs.map( 20 | (crumb, i) => 21 | crumb.path && 22 | !crumb.skipBreadcrumb && ( 23 |
24 | 25 | 28 | {crumb.title} 29 | 30 | 31 | 37 | 41 | 42 | 43 | 44 |
45 | ) 46 | )} 47 |
48 | ); 49 | } 50 | 51 | export default Breadcrumbs; 52 | -------------------------------------------------------------------------------- /src/components/Icon/IconDeepDive.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | 14 | export const IconDeepDive = memo( 15 | function IconDeepDive({className}) { 16 | return ( 17 | 24 | 30 | 31 | ); 32 | } 33 | ); 34 | -------------------------------------------------------------------------------- /src/components/Icon/IconHint.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import cn from 'classnames'; 14 | 15 | export const IconHint = memo(function IconHint({ 16 | className, 17 | }) { 18 | return ( 19 | 25 | 29 | 30 | ); 31 | }); 32 | -------------------------------------------------------------------------------- /src/content/reference/react-dom/components/progress.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "" 3 | --- 4 | 5 | 6 | 7 | The [built-in browser `` component](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress) lets you render a progress indicator. 8 | 9 | ```js 10 | 11 | ``` 12 | 13 | 14 | 15 | 16 | 17 | --- 18 | 19 | ## Reference {/*reference*/} 20 | 21 | ### `` {/*progress*/} 22 | 23 | To display a progress indicator, render the [built-in browser ``](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress) component. 24 | 25 | ```js 26 | 27 | ``` 28 | 29 | [See more examples below.](#usage) 30 | 31 | #### Props {/*props*/} 32 | 33 | `` supports all [common element props.](/reference/react-dom/components/common#common-props) 34 | 35 | Additionally, `` supports these props: 36 | 37 | * [`max`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#max): A number. Specifies the maximum `value`. Defaults to `1`. 38 | * [`value`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#value): A number between `0` and `max`, or `null` for indeterminate progress. Specifies how much was done. 39 | 40 | --- 41 | 42 | ## Usage {/*usage*/} 43 | 44 | ### Controlling a progress indicator {/*controlling-a-progress-indicator*/} 45 | 46 | To display a progress indicator, render a `` component. You can pass a number `value` between `0` and the `max` value you specify. If you don't pass a `max` value, it will assumed to be `1` by default. 47 | 48 | If the operation is not ongoing, pass `value={null}` to put the progress indicator into an indeterminate state. 49 | 50 | 51 | 52 | ```js 53 | export default function App() { 54 | return ( 55 | <> 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | ); 64 | } 65 | ``` 66 | 67 | ```css 68 | progress { display: block; } 69 | ``` 70 | 71 | 72 | -------------------------------------------------------------------------------- /src/components/Icon/IconChevron.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | import cn from 'classnames'; 14 | 15 | export const IconChevron = memo< 16 | JSX.IntrinsicElements['svg'] & { 17 | /** 18 | * The direction the arrow should point. 19 | * `start` and `end` are relative to the current locale. 20 | * for example, in LTR, `start` is left and `end` is right. 21 | */ 22 | displayDirection: 'start' | 'end' | 'right' | 'left' | 'up' | 'down'; 23 | } 24 | >(function IconChevron({className, displayDirection}) { 25 | const classes = cn( 26 | { 27 | 'rotate-0': displayDirection === 'down', 28 | 'rotate-90': displayDirection === 'left', 29 | 'rotate-180': displayDirection === 'up', 30 | '-rotate-90': displayDirection === 'right', 31 | 'rotate-90 rtl:-rotate-90': displayDirection === 'start', 32 | '-rotate-90 rtl:rotate-90': displayDirection === 'end', 33 | }, 34 | className 35 | ); 36 | return ( 37 | 43 | 44 | 50 | 51 | 52 | 53 | ); 54 | }); 55 | -------------------------------------------------------------------------------- /.github/workflows/analyze_comment.yml: -------------------------------------------------------------------------------- 1 | name: Analyze Bundle (Comment) 2 | 3 | on: 4 | workflow_run: 5 | workflows: ['Analyze Bundle'] 6 | types: 7 | - completed 8 | 9 | permissions: 10 | contents: read 11 | issues: write 12 | pull-requests: write 13 | 14 | jobs: 15 | comment: 16 | runs-on: ubuntu-latest 17 | if: > 18 | ${{ github.event.workflow_run.event == 'pull_request' && 19 | github.event.workflow_run.conclusion == 'success' }} 20 | steps: 21 | - name: Download base branch bundle stats 22 | uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e 23 | with: 24 | workflow: analyze.yml 25 | run_id: ${{ github.event.workflow_run.id }} 26 | name: analysis_comment.txt 27 | path: analysis_comment.txt 28 | 29 | - name: Download PR number 30 | uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e 31 | with: 32 | workflow: analyze.yml 33 | run_id: ${{ github.event.workflow_run.id }} 34 | name: pr_number 35 | path: pr_number 36 | 37 | - name: Get comment body 38 | id: get-comment-body 39 | if: success() 40 | run: | 41 | echo 'body<> $GITHUB_OUTPUT 42 | echo '' >> $GITHUB_OUTPUT 43 | echo '## Size changes' >> $GITHUB_OUTPUT 44 | echo '' >> $GITHUB_OUTPUT 45 | echo '
' >> $GITHUB_OUTPUT 46 | echo '' >> $GITHUB_OUTPUT 47 | cat analysis_comment.txt/__bundle_analysis_comment.txt >> $GITHUB_OUTPUT 48 | echo '' >> $GITHUB_OUTPUT 49 | echo '
' >> $GITHUB_OUTPUT 50 | echo '' >> $GITHUB_OUTPUT 51 | echo 'EOF' >> $GITHUB_OUTPUT 52 | pr_number=$(cat pr_number/pr_number) 53 | echo "pr-number=$pr_number" >> $GITHUB_OUTPUT 54 | 55 | - name: Comment 56 | uses: marocchino/sticky-pull-request-comment@52423e01640425a022ef5fd42c6fb5f633a02728 57 | with: 58 | header: next-bundle-analysis 59 | number: ${{ steps.get-comment-body.outputs.pr-number }} 60 | message: ${{ steps.get-comment-body.outputs.body }} 61 | -------------------------------------------------------------------------------- /src/components/Icon/IconDownload.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | 14 | export const IconDownload = memo( 15 | function IconDownload({className}) { 16 | return ( 17 | 24 | 28 | 32 | 33 | ); 34 | } 35 | ); 36 | -------------------------------------------------------------------------------- /src/content/reference/react-compiler/panicThreshold.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: panicThreshold 3 | --- 4 | 5 | 6 | 7 | The `panicThreshold` option controls how the React Compiler handles errors during compilation. 8 | 9 | 10 | 11 | ```js 12 | { 13 | panicThreshold: 'none' // Recommended 14 | } 15 | ``` 16 | 17 | 18 | 19 | --- 20 | 21 | ## Reference {/*reference*/} 22 | 23 | ### `panicThreshold` {/*panicthreshold*/} 24 | 25 | Determines whether compilation errors should fail the build or skip optimization. 26 | 27 | #### Type {/*type*/} 28 | 29 | ``` 30 | 'none' | 'critical_errors' | 'all_errors' 31 | ``` 32 | 33 | #### Default value {/*default-value*/} 34 | 35 | `'none'` 36 | 37 | #### Options {/*options*/} 38 | 39 | - **`'none'`** (default, recommended): Skip components that can't be compiled and continue building 40 | - **`'critical_errors'`**: Fail the build only on critical compiler errors 41 | - **`'all_errors'`**: Fail the build on any compiler diagnostic 42 | 43 | #### Caveats {/*caveats*/} 44 | 45 | - Production builds should always use `'none'` 46 | - Build failures prevent your application from building 47 | - The compiler automatically detects and skips problematic code with `'none'` 48 | - Higher thresholds are only useful during development for debugging 49 | 50 | --- 51 | 52 | ## Usage {/*usage*/} 53 | 54 | ### Production configuration (recommended) {/*production-configuration*/} 55 | 56 | For production builds, always use `'none'`. This is the default value: 57 | 58 | ```js 59 | { 60 | panicThreshold: 'none' 61 | } 62 | ``` 63 | 64 | This ensures: 65 | - Your build never fails due to compiler issues 66 | - Components that can't be optimized run normally 67 | - Maximum components get optimized 68 | - Stable production deployments 69 | 70 | ### Development debugging {/*development-debugging*/} 71 | 72 | Temporarily use stricter thresholds to find issues: 73 | 74 | ```js 75 | const isDevelopment = process.env.NODE_ENV === 'development'; 76 | 77 | { 78 | panicThreshold: isDevelopment ? 'critical_errors' : 'none', 79 | logger: { 80 | logEvent(filename, event) { 81 | if (isDevelopment && event.kind === 'CompileError') { 82 | // ... 83 | } 84 | } 85 | } 86 | } 87 | ``` -------------------------------------------------------------------------------- /src/components/Icon/IconPitfall.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* 9 | * Copyright (c) Facebook, Inc. and its affiliates. 10 | */ 11 | 12 | import {memo} from 'react'; 13 | 14 | export const IconPitfall = memo( 15 | function IconPitfall({className}) { 16 | return ( 17 | 24 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | ); 39 | } 40 | ); 41 | --------------------------------------------------------------------------------