├── pnpm-workspace.yaml ├── assets └── greatfrontend.gif ├── .prettierrc ├── __template__ └── todo-change-me │ ├── en-US.mdx │ └── metadata.json ├── questions ├── explain-what-react-hydration-is │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-virtual-dom-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ ├── zh-CN.mdx │ └── en-US.mdx ├── what-are-react-portals-used-for │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-are-the-rules-of-react-hooks │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-jsx-and-how-does-it-work │ ├── metadata.json │ ├── en-US.langnostic.json │ ├── zh-CN.mdx │ └── en-US.mdx ├── what-is-reconciliation-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── how-do-you-debug-react-applications │ ├── metadata.json │ └── en-US.langnostic.json ├── what-are-some-react-anti-patterns │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── how-do-you-test-react-applications │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-are-react-fragments-used-for │ ├── metadata.json │ ├── en-US.langnostic.json │ ├── zh-CN.mdx │ └── en-US.mdx ├── what-does-re-rendering-mean-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-are-error-boundaries-in-react-for │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-forwardref-in-react-used-for │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── explain-the-composition-pattern-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── how-do-you-localize-react-applications │ ├── metadata.json │ └── en-US.langnostic.json ├── what-are-higher-order-components-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-are-the-benefits-of-using-hooks-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ ├── zh-CN.mdx │ └── en-US.mdx ├── what-is-code-splitting-in-a-react-application │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-react-describe-the-benefits-of-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-purpose-of-the-key-prop-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── how-do-you-reset-a-components-state-in-react │ ├── metadata.json │ └── en-US.langnostic.json ├── what-does-the-dependency-array-of-useeffect-affect │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-react-suspense-and-what-does-it-enable │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── why-does-react-recommend-against-mutating-state │ ├── metadata.json │ ├── en-US.langnostic.json │ ├── zh-CN.mdx │ └── en-US.mdx ├── explain-one-way-data-flow-of-react-and-its-benefits │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-are-some-pitfalls-about-using-context-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-react-strict-mode-and-what-are-its-benefits │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-flux-pattern-and-what-are-its-benefits │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── explain-what-happens-when-setstate-is-called-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-are-render-props-in-react-and-what-are-they-for │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-difference-between-state-and-props-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-useid-hook-in-react-and-when-should-it-be-used │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-usememo-hook-in-react-and-when-should-it-be-used │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-useref-hook-in-react-and-when-should-it-be-used │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── explain-static-generation-of-react-applications-and-its-benefits │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-are-some-common-pitfalls-when-doing-data-fetching-in-react │ ├── metadata.json │ └── en-US.langnostic.json ├── what-is-the-usecallback-hook-in-react-and-when-should-it-be-used │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-usereducer-hook-in-react-and-when-should-it-be-used │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── explain-the-presentational-vs-container-component-pattern-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-difference-between-useeffect-and-uselayouteffect-in-react │ ├── metadata.json │ └── en-US.langnostic.json ├── explain-server-side-rendering-of-react-applications-and-its-benefits │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── how-do-you-handle-asynchronous-data-loading-in-react-applications │ ├── metadata.json │ └── en-US.langnostic.json ├── how-does-virtual-dom-in-react-work-what-are-its-benefits-and-downsides │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-difference-between-controlled-and-uncontrolled-react-components │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-react-fiber-and-how-is-it-an-improvement-over-the-previous-approach │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── what-is-the-difference-between-react-node-react-element-and-a-react-component │ ├── metadata.json │ ├── en-US.langnostic.json │ ├── zh-CN.mdx │ └── en-US.mdx ├── how-do-you-decide-between-using-react-state-context-and-external-state-managers │ ├── metadata.json │ └── en-US.langnostic.json ├── what-is-the-consequence-of-using-array-indices-as-the-value-for-key-s-in-react │ ├── metadata.json │ ├── en-US.langnostic.json │ ├── zh-CN.mdx │ └── en-US.mdx ├── how-would-one-optimize-the-performance-of-react-contexts-to-reduce-rerenders │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx └── what-is-the-purpose-of-callback-function-argument-format-of-setstate-in-react-and-when-should-it-be-used │ ├── metadata.json │ ├── en-US.langnostic.json │ └── zh-CN.mdx ├── langnostic.config.ts ├── scripts ├── types.ts └── sync.ts ├── package.json ├── .github └── workflows │ └── gen-toc.yml └── .gitignore /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | # To let pnpm know this is the repo root as it's also installed as a submodule 2 | -------------------------------------------------------------------------------- /assets/greatfrontend.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangshun/top-reactjs-interview-questions/HEAD/assets/greatfrontend.gif -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "bracketSameLine": true, 3 | "printWidth": 80, 4 | "proseWrap": "never", 5 | "singleQuote": true, 6 | "trailingComma": "all" 7 | } 8 | -------------------------------------------------------------------------------- /__template__/todo-change-me/en-US.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: TODO_REPLACE_TITLE 3 | --- 4 | 5 | ## TL;DR 6 | 7 | 8 | 9 | --- 10 | 11 | ## Some heading 12 | 13 | TODO 14 | 15 | ## Further reading 16 | 17 | - [Foo](#foo) 18 | - [Bar](#bar) 19 | -------------------------------------------------------------------------------- /__template__/todo-change-me/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "todo-change-me", 3 | "languages": [], 4 | "companies": [], 5 | "premium": false, 6 | "duration": 5, 7 | "published": false, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["javascript"], 11 | "importance": "low", 12 | "ranking": 999, 13 | "difficulty": "easy" 14 | } 15 | -------------------------------------------------------------------------------- /questions/explain-what-react-hydration-is/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "explain-what-react-hydration-is", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 260, 14 | "difficulty": "hard", 15 | "section": "advanced" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-virtual-dom-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-virtual-dom-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 450, 14 | "difficulty": "hard", 15 | "section": "internals" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-react-portals-used-for/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-react-portals-used-for", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 270, 14 | "difficulty": "hard", 15 | "section": "advanced" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-the-rules-of-react-hooks/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-the-rules-of-react-hooks", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 100, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-jsx-and-how-does-it-work/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-jsx-and-how-does-it-work", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 30, 14 | "difficulty": "medium", 15 | "section": "basics" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-reconciliation-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-reconciliation-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 480, 14 | "difficulty": "hard", 15 | "section": "internals" 16 | } 17 | -------------------------------------------------------------------------------- /questions/how-do-you-debug-react-applications/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "how-do-you-debug-react-applications", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 280, 14 | "difficulty": "hard", 15 | "section": "advanced" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-some-react-anti-patterns/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-some-react-anti-patterns", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 420, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/how-do-you-test-react-applications/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "how-do-you-test-react-applications", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 250, 14 | "difficulty": "medium", 15 | "section": "intermediate" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-react-fragments-used-for/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-react-fragments-used-for", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 200, 14 | "difficulty": "medium", 15 | "section": "intermediate" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-does-re-rendering-mean-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-does-re-rendering-mean-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 190, 14 | "difficulty": "hard", 15 | "section": "intermediate" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-error-boundaries-in-react-for/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-error-boundaries-in-react-for", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 240, 14 | "difficulty": "medium", 15 | "section": "intermediate" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-forwardref-in-react-used-for/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-forwardref-in-react-used-for", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 210, 14 | "difficulty": "medium", 15 | "section": "intermediate" 16 | } 17 | -------------------------------------------------------------------------------- /questions/explain-the-composition-pattern-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "explain-the-composition-pattern-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 440, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/how-do-you-localize-react-applications/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "how-do-you-localize-react-applications", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react", "i18n"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 300, 14 | "difficulty": "medium", 15 | "section": "advanced" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-higher-order-components-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-higher-order-components-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 330, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-the-benefits-of-using-hooks-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-the-benefits-of-using-hooks-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 90, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-code-splitting-in-a-react-application/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-code-splitting-in-a-react-application", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 310, 14 | "difficulty": "medium", 15 | "section": "advanced" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-react-describe-the-benefits-of-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-react-describe-the-benefits-of-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 10, 14 | "difficulty": "medium", 15 | "section": "basics" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-purpose-of-the-key-prop-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-purpose-of-the-key-prop-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 50, 14 | "difficulty": "medium", 15 | "section": "basics" 16 | } 17 | -------------------------------------------------------------------------------- /questions/how-do-you-reset-a-components-state-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "how-do-you-reset-a-components-state-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 220, 14 | "difficulty": "medium", 15 | "section": "intermediate" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-does-the-dependency-array-of-useeffect-affect/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-does-the-dependency-array-of-useeffect-affect", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 130, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-react-suspense-and-what-does-it-enable/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-react-suspense-and-what-does-it-enable", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 490, 14 | "difficulty": "medium", 15 | "section": "internals" 16 | } 17 | -------------------------------------------------------------------------------- /questions/why-does-react-recommend-against-mutating-state/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "why-does-react-recommend-against-mutating-state", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 230, 14 | "difficulty": "hard", 15 | "section": "intermediate" 16 | } 17 | -------------------------------------------------------------------------------- /questions/explain-one-way-data-flow-of-react-and-its-benefits/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "explain-one-way-data-flow-of-react-and-its-benefits", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 350, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-some-pitfalls-about-using-context-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-some-pitfalls-about-using-context-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 80, 14 | "difficulty": "medium", 15 | "section": "basics" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-react-strict-mode-and-what-are-its-benefits/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-react-strict-mode-and-what-are-its-benefits", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 290, 14 | "difficulty": "medium", 15 | "section": "advanced" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-flux-pattern-and-what-are-its-benefits/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-flux-pattern-and-what-are-its-benefits", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 340, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/explain-what-happens-when-setstate-is-called-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "explain-what-happens-when-setstate-is-called-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 500, 14 | "difficulty": "medium", 15 | "section": "internals" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-render-props-in-react-and-what-are-they-for/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-render-props-in-react-and-what-are-they-for", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 410, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-difference-between-state-and-props-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-difference-between-state-and-props-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 40, 14 | "difficulty": "easy", 15 | "section": "basics" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-useid-hook-in-react-and-when-should-it-be-used/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-useid-hook-in-react-and-when-should-it-be-used", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 180, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-usememo-hook-in-react-and-when-should-it-be-used/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-usememo-hook-in-react-and-when-should-it-be-used", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 160, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-useref-hook-in-react-and-when-should-it-be-used/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-useref-hook-in-react-and-when-should-it-be-used", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 140, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /questions/explain-static-generation-of-react-applications-and-its-benefits/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "explain-static-generation-of-react-applications-and-its-benefits", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 380, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-are-some-common-pitfalls-when-doing-data-fetching-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-are-some-common-pitfalls-when-doing-data-fetching-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 400, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-usecallback-hook-in-react-and-when-should-it-be-used/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-usecallback-hook-in-react-and-when-should-it-be-used", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 150, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-usereducer-hook-in-react-and-when-should-it-be-used/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-usereducer-hook-in-react-and-when-should-it-be-used", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 170, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /langnostic.config.ts: -------------------------------------------------------------------------------- 1 | import { ConfigType } from 'langnostic'; 2 | 3 | export default { 4 | ai: { 5 | provider: 'google', 6 | }, 7 | localeConfig: { 8 | source: 'en-US', 9 | target: ['zh-CN'], 10 | }, 11 | groups: [ 12 | { 13 | name: 'quiz-react', 14 | plugin: 'mdx', 15 | paths: [ 16 | { 17 | source: './questions/*/en-US.mdx', 18 | target: './questions/*/{locale}.mdx', 19 | }, 20 | ], 21 | }, 22 | ], 23 | } satisfies ConfigType; 24 | -------------------------------------------------------------------------------- /questions/explain-the-presentational-vs-container-component-pattern-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "explain-the-presentational-vs-container-component-pattern-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 390, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-difference-between-useeffect-and-uselayouteffect-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-difference-between-useeffect-and-uselayouteffect-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 110, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /questions/explain-server-side-rendering-of-react-applications-and-its-benefits/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "explain-server-side-rendering-of-react-applications-and-its-benefits", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 370, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/how-do-you-handle-asynchronous-data-loading-in-react-applications/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "how-do-you-handle-asynchronous-data-loading-in-react-applications", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react", "async"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 360, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/how-does-virtual-dom-in-react-work-what-are-its-benefits-and-downsides/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "how-does-virtual-dom-in-react-work-what-are-its-benefits-and-downsides", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 460, 14 | "difficulty": "hard", 15 | "section": "internals" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-difference-between-controlled-and-uncontrolled-react-components/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-difference-between-controlled-and-uncontrolled-react-components", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 70, 14 | "difficulty": "medium", 15 | "section": "basics" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-react-fiber-and-how-is-it-an-improvement-over-the-previous-approach/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-react-fiber-and-how-is-it-an-improvement-over-the-previous-approach", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 470, 14 | "difficulty": "hard", 15 | "section": "internals" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-difference-between-react-node-react-element-and-a-react-component/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-difference-between-react-node-react-element-and-a-react-component", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 20, 14 | "difficulty": "medium", 15 | "section": "basics" 16 | } 17 | -------------------------------------------------------------------------------- /questions/how-do-you-decide-between-using-react-state-context-and-external-state-managers/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "how-do-you-decide-between-using-react-state-context-and-external-state-managers", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 430, 14 | "difficulty": "medium", 15 | "section": "patterns" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-consequence-of-using-array-indices-as-the-value-for-key-s-in-react/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-consequence-of-using-array-indices-as-the-value-for-key-s-in-react", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "medium", 13 | "ranking": 60, 14 | "difficulty": "medium", 15 | "section": "basics" 16 | } 17 | -------------------------------------------------------------------------------- /questions/how-would-one-optimize-the-performance-of-react-contexts-to-reduce-rerenders/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "how-would-one-optimize-the-performance-of-react-contexts-to-reduce-rerenders", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react", "performance"], 11 | "frameworks": ["react"], 12 | "importance": "high", 13 | "ranking": 320, 14 | "difficulty": "medium", 15 | "section": "advanced" 16 | } 17 | -------------------------------------------------------------------------------- /questions/what-is-the-purpose-of-callback-function-argument-format-of-setstate-in-react-and-when-should-it-be-used/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "slug": "what-is-the-purpose-of-callback-function-argument-format-of-setstate-in-react-and-when-should-it-be-used", 3 | "languages": [], 4 | "companies": [], 5 | "access": "free", 6 | "duration": 5, 7 | "published": true, 8 | "featured": true, 9 | "category": "react", 10 | "topics": ["react"], 11 | "frameworks": ["react"], 12 | "importance": "low", 13 | "ranking": 120, 14 | "difficulty": "medium", 15 | "section": "hooks" 16 | } 17 | -------------------------------------------------------------------------------- /scripts/types.ts: -------------------------------------------------------------------------------- 1 | export type QuestionMetadata = Readonly<{ 2 | published: boolean; 3 | slug: string; 4 | ranking: number; 5 | importance: string; 6 | featured: boolean; 7 | }>; 8 | 9 | export type QuestionFrontmatter = Readonly<{ 10 | title: string; 11 | }>; 12 | 13 | export type QuestionItem = Readonly<{ 14 | metadata: QuestionMetadata; 15 | href: string; 16 | title: string; 17 | titleSlug: string; 18 | locale: string; 19 | content: string; 20 | }>; 21 | 22 | // From parsed CSV. 23 | export type QuestionRaw = Readonly<{ 24 | slug: string; 25 | title: string; 26 | ranking: number; 27 | section: string; 28 | }>; 29 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "top-reactjs-interview-questions", 3 | "version": "1.0.0", 4 | "description": "List of top React interview questions", 5 | "main": "index.js", 6 | "scripts": { 7 | "gen": "tsx scripts/gen.ts", 8 | "sync": "tsx scripts/sync.ts", 9 | "i18n": "langnostic translate" 10 | }, 11 | "keywords": [ 12 | "javascript", 13 | "interview", 14 | "questions" 15 | ], 16 | "author": "yangshun", 17 | "license": "ISC", 18 | "dependencies": { 19 | "@types/node": "^20.14.2", 20 | "csv-parse": "^5.5.6", 21 | "github-slugger": "^2.0.0", 22 | "globby": "^14.0.1", 23 | "gray-matter": "^4.0.3", 24 | "langnostic": "^0.0.8", 25 | "tsx": "^4.15.1" 26 | }, 27 | "devDependencies": { 28 | "typescript": "^5.8.2" 29 | }, 30 | "engines": { 31 | "node": ">= 22.15.0" 32 | }, 33 | "packageManager": "pnpm@10.9.0" 34 | } 35 | -------------------------------------------------------------------------------- /questions/what-is-the-difference-between-react-node-react-element-and-a-react-component/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "8feb9b4e" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "e57ace0a", 11 | "2a7816d0", 12 | "db2104d1", 13 | "1d2f13cf", 14 | "5c2a81c6", 15 | "d8144183", 16 | "1e7edf1", 17 | "d974c44a", 18 | "f78b3a8f", 19 | "8b4fde5a", 20 | "e1ff7345", 21 | "1f4770e5", 22 | "a474117" 23 | ] 24 | }, 25 | "targets": { 26 | "zh-CN": [ 27 | "77da26a5", 28 | "e57ace0a", 29 | "2a7816d0", 30 | "db2104d1", 31 | "1d2f13cf", 32 | "5c2a81c6", 33 | "d8144183", 34 | "1e7edf1", 35 | "d974c44a", 36 | "f78b3a8f", 37 | "8b4fde5a", 38 | "e1ff7345", 39 | "1f4770e5", 40 | "a474117" 41 | ] 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /questions/what-does-the-dependency-array-of-useeffect-affect/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "a308a791" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "a9bbe1f4", 11 | "2a7816d0", 12 | "677e111a", 13 | "6d2be08c", 14 | "f2fc784e", 15 | "69538c71", 16 | "9d4d559d", 17 | "324bbb23", 18 | "a1c25b61", 19 | "b778d1bb", 20 | "d494e056", 21 | "fe32bc78", 22 | "1f4770e5", 23 | "1ec7714" 24 | ] 25 | }, 26 | "targets": { 27 | "zh-CN": [ 28 | "77da26a5", 29 | "a9bbe1f4", 30 | "2a7816d0", 31 | "677e111a", 32 | "6d2be08c", 33 | "f2fc784e", 34 | "69538c71", 35 | "9d4d559d", 36 | "324bbb23", 37 | "a1c25b61", 38 | "b778d1bb", 39 | "d494e056", 40 | "fe32bc78", 41 | "1f4770e5", 42 | "1ec7714" 43 | ] 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /questions/what-is-virtual-dom-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "673f7cc3" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "101b6b73", 11 | "2a7816d0", 12 | "3abd7d7", 13 | "83283a80", 14 | "9ab3a4db", 15 | "4e8ede6c", 16 | "d9194b1b", 17 | "2819c383", 18 | "d536590c", 19 | "9b5019f0", 20 | "45656029", 21 | "c5b1f058", 22 | "528e3a81", 23 | "1f4770e5", 24 | "52bdcb5c" 25 | ] 26 | }, 27 | "targets": { 28 | "zh-CN": [ 29 | "77da26a5", 30 | "101b6b73", 31 | "2a7816d0", 32 | "3abd7d7", 33 | "83283a80", 34 | "9ab3a4db", 35 | "4e8ede6c", 36 | "d9194b1b", 37 | "2819c383", 38 | "d536590c", 39 | "9b5019f0", 40 | "45656029", 41 | "c5b1f058", 42 | "528e3a81", 43 | "1f4770e5", 44 | "52bdcb5c" 45 | ] 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /questions/how-would-one-optimize-the-performance-of-react-contexts-to-reduce-rerenders/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "bad88451" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "2373cc1e", 11 | "c0c3890c", 12 | "2a7816d0", 13 | "4bf584f2", 14 | "842bf7e8", 15 | "ca0350ad", 16 | "8b3145d3", 17 | "b0a712ce", 18 | "274caa8f", 19 | "4759a135", 20 | "7ee77cb7", 21 | "67d1483d", 22 | "c91eea09", 23 | "1f4770e5", 24 | "ff3d501d" 25 | ] 26 | }, 27 | "targets": { 28 | "zh-CN": [ 29 | "77da26a5", 30 | "2373cc1e", 31 | "c0c3890c", 32 | "2a7816d0", 33 | "4bf584f2", 34 | "842bf7e8", 35 | "ca0350ad", 36 | "8b3145d3", 37 | "b0a712ce", 38 | "274caa8f", 39 | "4759a135", 40 | "7ee77cb7", 41 | "67d1483d", 42 | "c91eea09", 43 | "1f4770e5", 44 | "ff3d501d" 45 | ] 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /questions/what-are-the-rules-of-react-hooks/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "c629b10" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "de8b3ee0", 11 | "2a7816d0", 12 | "f5aba161", 13 | "ed720c14", 14 | "16f17360", 15 | "2cc993f2", 16 | "ac41889a", 17 | "9a4391aa", 18 | "138f48cb", 19 | "40ffa3ae", 20 | "5d83599a", 21 | "5497be2f", 22 | "4b6b601a", 23 | "5b71e887", 24 | "1f4770e5", 25 | "3ad62e32" 26 | ] 27 | }, 28 | "targets": { 29 | "zh-CN": [ 30 | "77da26a5", 31 | "de8b3ee0", 32 | "2a7816d0", 33 | "f5aba161", 34 | "ed720c14", 35 | "16f17360", 36 | "2cc993f2", 37 | "ac41889a", 38 | "9a4391aa", 39 | "138f48cb", 40 | "40ffa3ae", 41 | "5d83599a", 42 | "5497be2f", 43 | "4b6b601a", 44 | "5b71e887", 45 | "1f4770e5", 46 | "3ad62e32" 47 | ] 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /questions/what-is-the-purpose-of-the-key-prop-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "2601e0d7" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "d2a2b38f", 11 | "be3278d7", 12 | "2a7816d0", 13 | "b4ec927b", 14 | "83283a80", 15 | "c06c7ca6", 16 | "7d8fd03c", 17 | "1e7a3ee9", 18 | "16dd4479", 19 | "33022fb4", 20 | "7ea1eb88", 21 | "2ff1b601", 22 | "ce982534", 23 | "20390e69", 24 | "1f4770e5", 25 | "5e88b75" 26 | ] 27 | }, 28 | "targets": { 29 | "zh-CN": [ 30 | "77da26a5", 31 | "d2a2b38f", 32 | "be3278d7", 33 | "2a7816d0", 34 | "b4ec927b", 35 | "83283a80", 36 | "c06c7ca6", 37 | "7d8fd03c", 38 | "1e7a3ee9", 39 | "16dd4479", 40 | "33022fb4", 41 | "7ea1eb88", 42 | "2ff1b601", 43 | "ce982534", 44 | "20390e69", 45 | "1f4770e5", 46 | "5e88b75" 47 | ] 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /questions/why-does-react-recommend-against-mutating-state/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "8ef415b" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "945aa235", 11 | "2a7816d0", 12 | "659d32f8", 13 | "aca26603", 14 | "688b93e4", 15 | "aace65b5", 16 | "f21a1285", 17 | "3ba086f", 18 | "fa3a5394", 19 | "c1c28417", 20 | "9e029a78", 21 | "d0d12f49", 22 | "79d9587b", 23 | "ecbd7a1a", 24 | "1f4770e5", 25 | "7aa2ae0" 26 | ] 27 | }, 28 | "targets": { 29 | "zh-CN": [ 30 | "77da26a5", 31 | "945aa235", 32 | "2a7816d0", 33 | "659d32f8", 34 | "aca26603", 35 | "688b93e4", 36 | "aace65b5", 37 | "f21a1285", 38 | "3ba086f", 39 | "fa3a5394", 40 | "c1c28417", 41 | "9e029a78", 42 | "d0d12f49", 43 | "79d9587b", 44 | "ecbd7a1a", 45 | "1f4770e5", 46 | "7aa2ae0" 47 | ] 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /questions/explain-what-happens-when-setstate-is-called-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "c395a10b" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "bc93022f", 11 | "2a7816d0", 12 | "ea57d6f1", 13 | "8bf1f14", 14 | "2b5b2680", 15 | "56f02148", 16 | "7b51019", 17 | "6ddd5305", 18 | "3294def3", 19 | "4610812b", 20 | "bdc4dbb4", 21 | "28eb626b", 22 | "9de13ed8", 23 | "f1596715", 24 | "1f4770e5", 25 | "fa842b3f" 26 | ] 27 | }, 28 | "targets": { 29 | "zh-CN": [ 30 | "77da26a5", 31 | "bc93022f", 32 | "2a7816d0", 33 | "ea57d6f1", 34 | "8bf1f14", 35 | "2b5b2680", 36 | "56f02148", 37 | "7b51019", 38 | "6ddd5305", 39 | "3294def3", 40 | "4610812b", 41 | "bdc4dbb4", 42 | "28eb626b", 43 | "9de13ed8", 44 | "f1596715", 45 | "1f4770e5", 46 | "fa842b3f" 47 | ] 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /.github/workflows/gen-toc.yml: -------------------------------------------------------------------------------- 1 | name: Generate table of contents 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - main 8 | 9 | jobs: 10 | gen-toc: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout code 14 | uses: actions/checkout@v3 15 | with: 16 | ref: ${{ github.head_ref }} 17 | - name: Install pnpm 18 | uses: pnpm/action-setup@v2 19 | - name: Install dependencies 20 | run: pnpm install 21 | - name: Generate table of contents 22 | run: npm run gen 23 | - name: 'Commit changes if required' 24 | run: | 25 | if ! git diff --quiet README.md; then 26 | git config user.email "github-actions[bot]@users.noreply.github.com" 27 | git config user.name "GitHub Actions" 28 | git add README.md 29 | git commit -m "[auto] regenerate table of contents" 30 | git push 31 | echo "[info] Table of contents updated and committed." 32 | else 33 | echo "[info] No changes to table of contents." 34 | fi 35 | working-directory: ${{ github.workspace }} 36 | -------------------------------------------------------------------------------- /questions/what-is-the-consequence-of-using-array-indices-as-the-value-for-key-s-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "74976db5" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "a96ea384", 11 | "2a7816d0", 12 | "2d88e1ef", 13 | "cd5858c6", 14 | "f1e6f589", 15 | "de6d76a0", 16 | "da2659c6", 17 | "9b5019f0", 18 | "2f9c8751", 19 | "6c730271", 20 | "a3337c67", 21 | "9c6171f", 22 | "91984c7a", 23 | "4cf9f513", 24 | "7ec7f19", 25 | "1f4770e5", 26 | "ee4913a3" 27 | ] 28 | }, 29 | "targets": { 30 | "zh-CN": [ 31 | "77da26a5", 32 | "a96ea384", 33 | "2a7816d0", 34 | "2d88e1ef", 35 | "cd5858c6", 36 | "f1e6f589", 37 | "de6d76a0", 38 | "da2659c6", 39 | "9b5019f0", 40 | "2f9c8751", 41 | "6c730271", 42 | "a3337c67", 43 | "9c6171f", 44 | "91984c7a", 45 | "4cf9f513", 46 | "7ec7f19", 47 | "1f4770e5", 48 | "ee4913a3" 49 | ] 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /questions/what-are-react-fragments-used-for/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "68d8dd3b" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "2c3f9550", 11 | "dd9fd698", 12 | "2a7816d0", 13 | "bf3278a0", 14 | "1f4d779f", 15 | "f3e08907", 16 | "a254281b", 17 | "9df49c4", 18 | "eea083fa", 19 | "6e4d142f", 20 | "fa14afe9", 21 | "76a96f35", 22 | "fe82c56", 23 | "98258d16", 24 | "6dd3b324", 25 | "b2e4f802", 26 | "1f4770e5", 27 | "3ecc2af2" 28 | ] 29 | }, 30 | "targets": { 31 | "zh-CN": [ 32 | "77da26a5", 33 | "2c3f9550", 34 | "dd9fd698", 35 | "2a7816d0", 36 | "bf3278a0", 37 | "1f4d779f", 38 | "f3e08907", 39 | "a254281b", 40 | "9df49c4", 41 | "eea083fa", 42 | "6e4d142f", 43 | "fa14afe9", 44 | "76a96f35", 45 | "fe82c56", 46 | "98258d16", 47 | "6dd3b324", 48 | "b2e4f802", 49 | "1f4770e5", 50 | "3ecc2af2" 51 | ] 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /questions/explain-what-react-hydration-is/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "1e9bbc14" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "7fb6ab38", 11 | "2a7816d0", 12 | "d0297b79", 13 | "16b36c26", 14 | "e5673308", 15 | "d4cfa24b", 16 | "58452457", 17 | "a4946601", 18 | "9b5019f0", 19 | "efc9687e", 20 | "be20f28a", 21 | "f59558f6", 22 | "7427c0b2", 23 | "18dc6284", 24 | "b473e52c", 25 | "13518d3f", 26 | "1f4770e5", 27 | "dab0684e" 28 | ] 29 | }, 30 | "targets": { 31 | "zh-CN": [ 32 | "77da26a5", 33 | "7fb6ab38", 34 | "2a7816d0", 35 | "d0297b79", 36 | "16b36c26", 37 | "e5673308", 38 | "d4cfa24b", 39 | "58452457", 40 | "a4946601", 41 | "9b5019f0", 42 | "efc9687e", 43 | "be20f28a", 44 | "f59558f6", 45 | "7427c0b2", 46 | "18dc6284", 47 | "b473e52c", 48 | "13518d3f", 49 | "1f4770e5", 50 | "dab0684e" 51 | ] 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /questions/what-is-reconciliation-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "6cd6cde0" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "395ad6b4", 11 | "2a7816d0", 12 | "70689fd5", 13 | "83283a80", 14 | "73b06133", 15 | "5ca1142e", 16 | "99ef4b1f", 17 | "567d60e7", 18 | "6ed53fbc", 19 | "d184173c", 20 | "d4cf191f", 21 | "50fae776", 22 | "9b5019f0", 23 | "a611c0e2", 24 | "289ac849", 25 | "f47f3922", 26 | "1f4770e5", 27 | "f1a2f6f6" 28 | ] 29 | }, 30 | "targets": { 31 | "zh-CN": [ 32 | "77da26a5", 33 | "395ad6b4", 34 | "2a7816d0", 35 | "70689fd5", 36 | "83283a80", 37 | "73b06133", 38 | "5ca1142e", 39 | "99ef4b1f", 40 | "567d60e7", 41 | "6ed53fbc", 42 | "d184173c", 43 | "d4cf191f", 44 | "50fae776", 45 | "9b5019f0", 46 | "a611c0e2", 47 | "289ac849", 48 | "f47f3922", 49 | "1f4770e5", 50 | "f1a2f6f6" 51 | ] 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /questions/what-is-react-suspense-and-what-does-it-enable/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "8ffa840b" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "371f1daf", 11 | "e19d9140", 12 | "2a7816d0", 13 | "84654cb7", 14 | "e13c0460", 15 | "26e79d86", 16 | "8d7ee4f", 17 | "163c801e", 18 | "e518ce63", 19 | "3bb9ecf1", 20 | "ee167ce", 21 | "5f97c4a8", 22 | "cd87b9ba", 23 | "c7a2ab39", 24 | "2f9739a9", 25 | "5b2826a2", 26 | "1f4770e5", 27 | "930b7f1b" 28 | ] 29 | }, 30 | "targets": { 31 | "zh-CN": [ 32 | "77da26a5", 33 | "371f1daf", 34 | "e19d9140", 35 | "2a7816d0", 36 | "84654cb7", 37 | "e13c0460", 38 | "26e79d86", 39 | "8d7ee4f", 40 | "163c801e", 41 | "e518ce63", 42 | "3bb9ecf1", 43 | "ee167ce", 44 | "5f97c4a8", 45 | "cd87b9ba", 46 | "c7a2ab39", 47 | "2f9739a9", 48 | "5b2826a2", 49 | "1f4770e5", 50 | "930b7f1b" 51 | ] 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /questions/explain-one-way-data-flow-of-react-and-its-benefits/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "74dcaf9" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "bf2da619", 11 | "2a7816d0", 12 | "f100e86a", 13 | "62e3785", 14 | "f9a4a61e", 15 | "9b5019f0", 16 | "bb6ad948", 17 | "512d4005", 18 | "df6d0005", 19 | "c32224bc", 20 | "349bbc4a", 21 | "389d0daa", 22 | "182800d5", 23 | "117d06f9", 24 | "98a50d6b", 25 | "f9866dae", 26 | "1f4770e5", 27 | "db46a0c" 28 | ] 29 | }, 30 | "targets": { 31 | "zh-CN": [ 32 | "77da26a5", 33 | "bf2da619", 34 | "2a7816d0", 35 | "f100e86a", 36 | "62e3785", 37 | "f9a4a61e", 38 | "9b5019f0", 39 | "bb6ad948", 40 | "512d4005", 41 | "df6d0005", 42 | "c32224bc", 43 | "349bbc4a", 44 | "389d0daa", 45 | "182800d5", 46 | "117d06f9", 47 | "98a50d6b", 48 | "f9866dae", 49 | "1f4770e5", 50 | "db46a0c" 51 | ] 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /questions/what-is-react-strict-mode-and-what-are-its-benefits/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "5f87efb5" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "840ffa08", 11 | "2a7816d0", 12 | "e5691f6a", 13 | "bd34032", 14 | "9eb5243b", 15 | "6210916a", 16 | "bab4ca0d", 17 | "12a78449", 18 | "1fb87459", 19 | "27a65bb7", 20 | "1b2bedd5", 21 | "6ef3f763", 22 | "35fba11a", 23 | "9095386", 24 | "f2048bc7", 25 | "ae476bdb", 26 | "1f4770e5", 27 | "bb590db9" 28 | ] 29 | }, 30 | "targets": { 31 | "zh-CN": [ 32 | "77da26a5", 33 | "840ffa08", 34 | "2a7816d0", 35 | "e5691f6a", 36 | "bd34032", 37 | "9eb5243b", 38 | "6210916a", 39 | "bab4ca0d", 40 | "12a78449", 41 | "1fb87459", 42 | "27a65bb7", 43 | "1b2bedd5", 44 | "6ef3f763", 45 | "35fba11a", 46 | "9095386", 47 | "f2048bc7", 48 | "ae476bdb", 49 | "1f4770e5", 50 | "bb590db9" 51 | ] 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /questions/what-are-some-pitfalls-about-using-context-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "7399b59d" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "5544ad8f", 11 | "2a7816d0", 12 | "889c6919", 13 | "cd5858c6", 14 | "487c5dfd", 15 | "748ffe75", 16 | "d46b78ac", 17 | "2c498dfb", 18 | "a92f301a", 19 | "70db662a", 20 | "67fefae4", 21 | "6ebe5176", 22 | "ca8721bd", 23 | "c40ecfa4", 24 | "706c6c06", 25 | "7342f74b", 26 | "1f4770e5", 27 | "dc6d6f1c" 28 | ] 29 | }, 30 | "targets": { 31 | "zh-CN": [ 32 | "77da26a5", 33 | "5544ad8f", 34 | "2a7816d0", 35 | "889c6919", 36 | "cd5858c6", 37 | "487c5dfd", 38 | "748ffe75", 39 | "d46b78ac", 40 | "2c498dfb", 41 | "a92f301a", 42 | "70db662a", 43 | "67fefae4", 44 | "6ebe5176", 45 | "ca8721bd", 46 | "c40ecfa4", 47 | "706c6c06", 48 | "7342f74b", 49 | "1f4770e5", 50 | "dc6d6f1c" 51 | ] 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /questions/what-is-the-purpose-of-callback-function-argument-format-of-setstate-in-react-and-when-should-it-be-used/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "b2fd6847" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "321d563c", 11 | "7174ec19", 12 | "2a7816d0", 13 | "8cb8b8df", 14 | "f028028d", 15 | "dc2dc65d", 16 | "eea083fa", 17 | "3e0714dd", 18 | "86822c1d", 19 | "9e786467", 20 | "9031225", 21 | "9b5019f0", 22 | "2ea79bbe", 23 | "23a510cf", 24 | "23970dcc", 25 | "1f4770e5", 26 | "373cd902" 27 | ] 28 | }, 29 | "targets": { 30 | "zh-CN": [ 31 | "77da26a5", 32 | "321d563c", 33 | "7174ec19", 34 | "2a7816d0", 35 | "8cb8b8df", 36 | "f028028d", 37 | "dc2dc65d", 38 | "eea083fa", 39 | "3e0714dd", 40 | "86822c1d", 41 | "9e786467", 42 | "9031225", 43 | "9b5019f0", 44 | "2ea79bbe", 45 | "23a510cf", 46 | "23970dcc", 47 | "1f4770e5", 48 | "373cd902" 49 | ] 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /questions/what-is-the-usecallback-hook-in-react-and-when-should-it-be-used/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "46266351" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "4eab0c12", 11 | "cb5c44ad", 12 | "2a7816d0", 13 | "236d8040", 14 | "67a21e91", 15 | "c141c5d", 16 | "eea083fa", 17 | "cb5c44ad", 18 | "1e359897", 19 | "b19fcba1", 20 | "8a97ac33", 21 | "1529ceee", 22 | "59b2ab0e", 23 | "13769acd", 24 | "4ab2c29f", 25 | "2af178e4", 26 | "1f4770e5", 27 | "36259355" 28 | ] 29 | }, 30 | "targets": { 31 | "zh-CN": [ 32 | "77da26a5", 33 | "4eab0c12", 34 | "cb5c44ad", 35 | "2a7816d0", 36 | "236d8040", 37 | "67a21e91", 38 | "c141c5d", 39 | "eea083fa", 40 | "cb5c44ad", 41 | "1e359897", 42 | "b19fcba1", 43 | "8a97ac33", 44 | "1529ceee", 45 | "59b2ab0e", 46 | "13769acd", 47 | "4ab2c29f", 48 | "2af178e4", 49 | "1f4770e5", 50 | "36259355" 51 | ] 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /questions/explain-the-composition-pattern-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "29cbb0d2" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "68db0f6f", 11 | "70512550", 12 | "2a7816d0", 13 | "53a643ed", 14 | "da9629f7", 15 | "f5a438e3", 16 | "7fa2d952", 17 | "59f30a47", 18 | "7b1deb12", 19 | "5d73d3", 20 | "42239dd9", 21 | "e566d65d", 22 | "9e8f9bed", 23 | "1a1967fd", 24 | "b201bd43", 25 | "fb38abd3", 26 | "4352471d", 27 | "1f4770e5", 28 | "35076104" 29 | ] 30 | }, 31 | "targets": { 32 | "zh-CN": [ 33 | "77da26a5", 34 | "68db0f6f", 35 | "70512550", 36 | "2a7816d0", 37 | "53a643ed", 38 | "da9629f7", 39 | "f5a438e3", 40 | "7fa2d952", 41 | "59f30a47", 42 | "7b1deb12", 43 | "5d73d3", 44 | "42239dd9", 45 | "e566d65d", 46 | "9e8f9bed", 47 | "1a1967fd", 48 | "b201bd43", 49 | "fb38abd3", 50 | "4352471d", 51 | "1f4770e5", 52 | "35076104" 53 | ] 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /questions/what-is-code-splitting-in-a-react-application/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "376f98fc" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "ed877c7c", 11 | "ac539b00", 12 | "2a7816d0", 13 | "bae1524", 14 | "83283a80", 15 | "df1bb8b5", 16 | "b9b23f65", 17 | "ba1d6dd2", 18 | "9faa97a2", 19 | "5a26f06e", 20 | "6cde9269", 21 | "83cf918c", 22 | "37977ef", 23 | "e739fb0a", 24 | "dda280ab", 25 | "351414c8", 26 | "a76f6320", 27 | "1f4770e5", 28 | "d8aa5534" 29 | ] 30 | }, 31 | "targets": { 32 | "zh-CN": [ 33 | "77da26a5", 34 | "ed877c7c", 35 | "ac539b00", 36 | "2a7816d0", 37 | "bae1524", 38 | "83283a80", 39 | "df1bb8b5", 40 | "b9b23f65", 41 | "ba1d6dd2", 42 | "9faa97a2", 43 | "5a26f06e", 44 | "6cde9269", 45 | "83cf918c", 46 | "37977ef", 47 | "e739fb0a", 48 | "dda280ab", 49 | "351414c8", 50 | "a76f6320", 51 | "1f4770e5", 52 | "d8aa5534" 53 | ] 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /questions/what-are-render-props-in-react-and-what-are-they-for/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "d75c0577" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "e8c61628", 11 | "2f6596c9", 12 | "2a7816d0", 13 | "3c2c8638", 14 | "25841bc3", 15 | "262197fc", 16 | "852a6583", 17 | "c62218a4", 18 | "5a5fd5cb", 19 | "4e8ede6c", 20 | "ace9d2e1", 21 | "9b5019f0", 22 | "7fefc5d8", 23 | "283d5b2f", 24 | "395f8bf1", 25 | "2819c383", 26 | "b3764a6c", 27 | "1f4770e5", 28 | "597b122f" 29 | ] 30 | }, 31 | "targets": { 32 | "zh-CN": [ 33 | "77da26a5", 34 | "e8c61628", 35 | "2f6596c9", 36 | "2a7816d0", 37 | "3c2c8638", 38 | "25841bc3", 39 | "262197fc", 40 | "852a6583", 41 | "c62218a4", 42 | "5a5fd5cb", 43 | "4e8ede6c", 44 | "ace9d2e1", 45 | "9b5019f0", 46 | "7fefc5d8", 47 | "283d5b2f", 48 | "395f8bf1", 49 | "2819c383", 50 | "b3764a6c", 51 | "1f4770e5", 52 | "597b122f" 53 | ] 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /questions/explain-the-presentational-vs-container-component-pattern-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "991928de" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "41868f26", 11 | "2a7816d0", 12 | "a8fea19e", 13 | "75a96b85", 14 | "ffbebcd0", 15 | "6bf6ed5b", 16 | "14cc7f39", 17 | "748ffe75", 18 | "7faaa789", 19 | "b99e9a39", 20 | "da5e9c4e", 21 | "6bf6ed5b", 22 | "1a3866ad", 23 | "748ffe75", 24 | "f600445", 25 | "2819c383", 26 | "11aa9a75", 27 | "1f4770e5", 28 | "4caa2581" 29 | ] 30 | }, 31 | "targets": { 32 | "zh-CN": [ 33 | "77da26a5", 34 | "41868f26", 35 | "2a7816d0", 36 | "a8fea19e", 37 | "75a96b85", 38 | "ffbebcd0", 39 | "6bf6ed5b", 40 | "14cc7f39", 41 | "748ffe75", 42 | "7faaa789", 43 | "b99e9a39", 44 | "da5e9c4e", 45 | "6bf6ed5b", 46 | "1a3866ad", 47 | "748ffe75", 48 | "f600445", 49 | "2819c383", 50 | "11aa9a75", 51 | "1f4770e5", 52 | "4caa2581" 53 | ] 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /questions/how-do-you-handle-asynchronous-data-loading-in-react-applications/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "881ca1be" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "b470c7e5", 11 | "e6409148", 12 | "2a7816d0", 13 | "c0577d0", 14 | "fc21e221", 15 | "b30e0c10", 16 | "16cac91a", 17 | "48145934", 18 | "3f6acdf2", 19 | "709d86f1", 20 | "37db7e81", 21 | "e50b6a62", 22 | "f337fed2", 23 | "8ced981", 24 | "b0115bf8", 25 | "2945cbb3", 26 | "25aeafcd", 27 | "1f4770e5", 28 | "80b0b37f" 29 | ] 30 | }, 31 | "targets": { 32 | "zh-CN": [ 33 | "77da26a5", 34 | "b470c7e5", 35 | "e6409148", 36 | "2a7816d0", 37 | "c0577d0", 38 | "fc21e221", 39 | "b30e0c10", 40 | "16cac91a", 41 | "48145934", 42 | "3f6acdf2", 43 | "709d86f1", 44 | "37db7e81", 45 | "e50b6a62", 46 | "f337fed2", 47 | "8ced981", 48 | "b0115bf8", 49 | "2945cbb3", 50 | "25aeafcd", 51 | "1f4770e5", 52 | "80b0b37f" 53 | ] 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /questions/what-does-re-rendering-mean-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "135f5269" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "1d4e45ef", 11 | "2a7816d0", 12 | "5f187ad8", 13 | "47e66d00", 14 | "f05cd80", 15 | "c91094f3", 16 | "b110cbae", 17 | "e394f752", 18 | "e629a8d9", 19 | "bd664992", 20 | "9b5019f0", 21 | "d95182d8", 22 | "62c52617", 23 | "670df17e", 24 | "3675e491", 25 | "c500fc82", 26 | "9d88969", 27 | "7646e3ce", 28 | "1f4770e5", 29 | "3c6d09b3" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "1d4e45ef", 36 | "2a7816d0", 37 | "5f187ad8", 38 | "47e66d00", 39 | "f05cd80", 40 | "c91094f3", 41 | "b110cbae", 42 | "e394f752", 43 | "e629a8d9", 44 | "bd664992", 45 | "9b5019f0", 46 | "d95182d8", 47 | "62c52617", 48 | "670df17e", 49 | "3675e491", 50 | "c500fc82", 51 | "9d88969", 52 | "7646e3ce", 53 | "1f4770e5", 54 | "3c6d09b3" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/what-is-forwardref-in-react-used-for/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "14f0637c" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "f005ab41", 11 | "8dde7c01", 12 | "2a7816d0", 13 | "93e000ed", 14 | "83283a80", 15 | "830b1b55", 16 | "e47d825", 17 | "8fe2e31b", 18 | "2f7df216", 19 | "143f45c6", 20 | "c554e7c5", 21 | "748ffe75", 22 | "5b86f2fd", 23 | "9f9e9fbe", 24 | "670df17e", 25 | "919e84c2", 26 | "3da76af2", 27 | "78365b8d", 28 | "1f4770e5", 29 | "d0643d37" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "f005ab41", 36 | "8dde7c01", 37 | "2a7816d0", 38 | "93e000ed", 39 | "83283a80", 40 | "830b1b55", 41 | "e47d825", 42 | "8fe2e31b", 43 | "2f7df216", 44 | "143f45c6", 45 | "c554e7c5", 46 | "748ffe75", 47 | "5b86f2fd", 48 | "9f9e9fbe", 49 | "670df17e", 50 | "919e84c2", 51 | "3da76af2", 52 | "78365b8d", 53 | "1f4770e5", 54 | "d0643d37" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/what-are-error-boundaries-in-react-for/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "339a56c6" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "4770976a", 11 | "2a7816d0", 12 | "b5e0f38a", 13 | "83283a80", 14 | "a4fc2d01", 15 | "826738fe", 16 | "81c423f4", 17 | "70b58868", 18 | "2c108148", 19 | "40f66da7", 20 | "4abfb705", 21 | "1a7866d1", 22 | "ea45e6ea", 23 | "5fedbc8e", 24 | "83b16d73", 25 | "cfb17e09", 26 | "3b882e5b", 27 | "5b143767", 28 | "1f4770e5", 29 | "34bdf19e" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "4770976a", 36 | "2a7816d0", 37 | "b5e0f38a", 38 | "83283a80", 39 | "a4fc2d01", 40 | "826738fe", 41 | "81c423f4", 42 | "70b58868", 43 | "2c108148", 44 | "40f66da7", 45 | "4abfb705", 46 | "1a7866d1", 47 | "ea45e6ea", 48 | "5fedbc8e", 49 | "83b16d73", 50 | "cfb17e09", 51 | "3b882e5b", 52 | "5b143767", 53 | "1f4770e5", 54 | "34bdf19e" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/what-is-react-describe-the-benefits-of-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "e59255f3" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "b4e26ad0", 11 | "861b27b9", 12 | "ee93075c", 13 | "2a7816d0", 14 | "fc564fd0", 15 | "80ed709b", 16 | "67ca0237", 17 | "a05a0d5", 18 | "7b0f69f1", 19 | "2a9bb992", 20 | "816351f7", 21 | "b5709a8f", 22 | "dfa0444d", 23 | "6218d568", 24 | "d2b4812d", 25 | "868f9ad", 26 | "787786ba", 27 | "cdc02c9", 28 | "1f4770e5", 29 | "dd5e4a01" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "b4e26ad0", 36 | "861b27b9", 37 | "ee93075c", 38 | "2a7816d0", 39 | "fc564fd0", 40 | "80ed709b", 41 | "67ca0237", 42 | "a05a0d5", 43 | "7b0f69f1", 44 | "2a9bb992", 45 | "816351f7", 46 | "b5709a8f", 47 | "dfa0444d", 48 | "6218d568", 49 | "d2b4812d", 50 | "868f9ad", 51 | "787786ba", 52 | "cdc02c9", 53 | "1f4770e5", 54 | "dd5e4a01" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/how-do-you-reset-a-components-state-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "738c44ca" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "e6520c6f", 11 | "df0a02de", 12 | "48d5ee42", 13 | "8d07a59b", 14 | "2a7816d0", 15 | "dc0ae19f", 16 | "46dcb5b2", 17 | "7c538db3", 18 | "748ffe75", 19 | "dcab6bcf", 20 | "879c865", 21 | "1f85a6d2", 22 | "748ffe75", 23 | "d0f47b39", 24 | "9fa54076", 25 | "ba92e928", 26 | "748ffe75", 27 | "a9d4bc55", 28 | "1f4770e5", 29 | "9b310d5c" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "e6520c6f", 36 | "df0a02de", 37 | "48d5ee42", 38 | "8d07a59b", 39 | "2a7816d0", 40 | "dc0ae19f", 41 | "46dcb5b2", 42 | "7c538db3", 43 | "748ffe75", 44 | "dcab6bcf", 45 | "879c865", 46 | "1f85a6d2", 47 | "748ffe75", 48 | "d0f47b39", 49 | "9fa54076", 50 | "ba92e928", 51 | "748ffe75", 52 | "a9d4bc55", 53 | "1f4770e5", 54 | "9b310d5c" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/what-are-the-benefits-of-using-hooks-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "25e4b0c8" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "e3fb8481", 11 | "2a7816d0", 12 | "2d5ea3ac", 13 | "c03b2e89", 14 | "c2da2016", 15 | "b2ddaf08", 16 | "449a157c", 17 | "96cb5355", 18 | "7fd9248", 19 | "26039123", 20 | "55a919a", 21 | "b34bf62d", 22 | "6895b306", 23 | "4bf1123f", 24 | "fd420608", 25 | "45e3d798", 26 | "5bc98c0b", 27 | "950368f4", 28 | "1f4770e5", 29 | "45ed957a" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "e3fb8481", 36 | "2a7816d0", 37 | "2d5ea3ac", 38 | "c03b2e89", 39 | "c2da2016", 40 | "b2ddaf08", 41 | "449a157c", 42 | "96cb5355", 43 | "7fd9248", 44 | "26039123", 45 | "55a919a", 46 | "b34bf62d", 47 | "6895b306", 48 | "4bf1123f", 49 | "fd420608", 50 | "45e3d798", 51 | "5bc98c0b", 52 | "950368f4", 53 | "1f4770e5", 54 | "45ed957a" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/what-is-the-useid-hook-in-react-and-when-should-it-be-used/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "f4b0277" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "c6fbfd6c", 11 | "f7434ccf", 12 | "2a7816d0", 13 | "72cfb6d8", 14 | "7f416508", 15 | "f91c2be4", 16 | "1d0b1259", 17 | "d2f3936b", 18 | "98866949", 19 | "f7434ccf", 20 | "31a10b33", 21 | "233f776f", 22 | "5e774e69", 23 | "98b862ac", 24 | "f5509c09", 25 | "a4881093", 26 | "3b882e5b", 27 | "80b8934c", 28 | "1f4770e5", 29 | "3a07aa36" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "c6fbfd6c", 36 | "f7434ccf", 37 | "2a7816d0", 38 | "72cfb6d8", 39 | "7f416508", 40 | "f91c2be4", 41 | "1d0b1259", 42 | "d2f3936b", 43 | "98866949", 44 | "f7434ccf", 45 | "31a10b33", 46 | "233f776f", 47 | "5e774e69", 48 | "98b862ac", 49 | "f5509c09", 50 | "a4881093", 51 | "3b882e5b", 52 | "80b8934c", 53 | "1f4770e5", 54 | "3a07aa36" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/what-are-some-common-pitfalls-when-doing-data-fetching-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "6051d09b" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "4003af38", 11 | "2a7816d0", 12 | "e8d1c6df", 13 | "65cf75d5", 14 | "6fd70b78", 15 | "190f5e6b", 16 | "7e0be3a2", 17 | "1145ea69", 18 | "e9921cce", 19 | "1e891578", 20 | "4aaf49d2", 21 | "5246fe1f", 22 | "52980d6c", 23 | "651f8f17", 24 | "d63001b7", 25 | "7cfd4e62", 26 | "66449215", 27 | "167d9a8", 28 | "1f4770e5", 29 | "2dead1cf" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "4003af38", 36 | "2a7816d0", 37 | "e8d1c6df", 38 | "65cf75d5", 39 | "6fd70b78", 40 | "190f5e6b", 41 | "7e0be3a2", 42 | "1145ea69", 43 | "e9921cce", 44 | "1e891578", 45 | "4aaf49d2", 46 | "5246fe1f", 47 | "52980d6c", 48 | "651f8f17", 49 | "d63001b7", 50 | "7cfd4e62", 51 | "66449215", 52 | "167d9a8", 53 | "1f4770e5", 54 | "2dead1cf" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/what-is-the-usereducer-hook-in-react-and-when-should-it-be-used/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "2848ef1d" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "aa9d0800", 11 | "5bbeab9a", 12 | "83a1eb62", 13 | "2a7816d0", 14 | "145deb4a", 15 | "672d5abb", 16 | "e749e1f", 17 | "eea083fa", 18 | "77f286d2", 19 | "5bbeab9a", 20 | "119efa90", 21 | "858ba261", 22 | "e316f675", 23 | "19c254ba", 24 | "ab232b6e", 25 | "6af9d4fa", 26 | "a21db932", 27 | "872ec8e3", 28 | "1f4770e5", 29 | "2383221b" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "aa9d0800", 36 | "5bbeab9a", 37 | "83a1eb62", 38 | "2a7816d0", 39 | "145deb4a", 40 | "672d5abb", 41 | "e749e1f", 42 | "eea083fa", 43 | "77f286d2", 44 | "5bbeab9a", 45 | "119efa90", 46 | "858ba261", 47 | "e316f675", 48 | "19c254ba", 49 | "ab232b6e", 50 | "6af9d4fa", 51 | "a21db932", 52 | "872ec8e3", 53 | "1f4770e5", 54 | "2383221b" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/what-is-the-difference-between-controlled-and-uncontrolled-react-components/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "a9bfa8d7" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "14c4b903", 11 | "2a7816d0", 12 | "dd977c16", 13 | "a6ae6ec", 14 | "27c9b634", 15 | "748ffe75", 16 | "65bd08f3", 17 | "2d0a03d7", 18 | "4aeacce6", 19 | "748ffe75", 20 | "71817d6b", 21 | "67423e0a", 22 | "dbaa40b1", 23 | "e89f2d30", 24 | "14d2459a", 25 | "f31b09dc", 26 | "f47a7738", 27 | "5dead499", 28 | "1f4770e5", 29 | "2a8c879d" 30 | ] 31 | }, 32 | "targets": { 33 | "zh-CN": [ 34 | "77da26a5", 35 | "14c4b903", 36 | "2a7816d0", 37 | "dd977c16", 38 | "a6ae6ec", 39 | "27c9b634", 40 | "748ffe75", 41 | "65bd08f3", 42 | "2d0a03d7", 43 | "4aeacce6", 44 | "748ffe75", 45 | "71817d6b", 46 | "67423e0a", 47 | "dbaa40b1", 48 | "e89f2d30", 49 | "14d2459a", 50 | "f31b09dc", 51 | "f47a7738", 52 | "5dead499", 53 | "1f4770e5", 54 | "2a8c879d" 55 | ] 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /questions/how-do-you-test-react-applications/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "28bf6b28" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "683ef68e", 11 | "2a7816d0", 12 | "1fa12836", 13 | "7c737123", 14 | "8ebc5a02", 15 | "748ffe75", 16 | "c4c911e", 17 | "ca7a8d03", 18 | "bc4a7117", 19 | "748ffe75", 20 | "1fa4fd4f", 21 | "3d29713c", 22 | "fbeb2223", 23 | "748ffe75", 24 | "599f6f2f", 25 | "d0b33059", 26 | "7f80f688", 27 | "748ffe75", 28 | "6b7c1b3e", 29 | "1f4770e5", 30 | "bca7d982" 31 | ] 32 | }, 33 | "targets": { 34 | "zh-CN": [ 35 | "77da26a5", 36 | "683ef68e", 37 | "2a7816d0", 38 | "1fa12836", 39 | "7c737123", 40 | "8ebc5a02", 41 | "748ffe75", 42 | "c4c911e", 43 | "ca7a8d03", 44 | "bc4a7117", 45 | "748ffe75", 46 | "1fa4fd4f", 47 | "3d29713c", 48 | "fbeb2223", 49 | "748ffe75", 50 | "599f6f2f", 51 | "d0b33059", 52 | "7f80f688", 53 | "748ffe75", 54 | "6b7c1b3e", 55 | "1f4770e5", 56 | "bca7d982" 57 | ] 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /questions/what-are-higher-order-components-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "dc83adae" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "b8e2b85d", 11 | "2e8bb27d", 12 | "2a7816d0", 13 | "48765d3d", 14 | "25841bc3", 15 | "2f8f66d7", 16 | "852a6583", 17 | "2ca50239", 18 | "3cfb08e5", 19 | "9b5019f0", 20 | "3aae1835", 21 | "a5e18a42", 22 | "d8025fc4", 23 | "9912c3a1", 24 | "e0153075", 25 | "3b882e5b", 26 | "aa2d6949", 27 | "14eca64f", 28 | "9969d9da", 29 | "1f4770e5", 30 | "d3b230ef" 31 | ] 32 | }, 33 | "targets": { 34 | "zh-CN": [ 35 | "77da26a5", 36 | "b8e2b85d", 37 | "2e8bb27d", 38 | "2a7816d0", 39 | "48765d3d", 40 | "25841bc3", 41 | "2f8f66d7", 42 | "852a6583", 43 | "2ca50239", 44 | "3cfb08e5", 45 | "9b5019f0", 46 | "3aae1835", 47 | "a5e18a42", 48 | "d8025fc4", 49 | "9912c3a1", 50 | "e0153075", 51 | "3b882e5b", 52 | "aa2d6949", 53 | "14eca64f", 54 | "9969d9da", 55 | "1f4770e5", 56 | "d3b230ef" 57 | ] 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /questions/what-is-the-difference-between-state-and-props-in-react/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "a2e309f6" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "bfcc6263", 11 | "2a7816d0", 12 | "c64b8fe5", 13 | "3a89f1f3", 14 | "b75b4336", 15 | "eba7f88c", 16 | "78384cad", 17 | "232c22ff", 18 | "fcd53b04", 19 | "721b4c55", 20 | "5002c978", 21 | "15dbbe0e", 22 | "574e1196", 23 | "ab6406bb", 24 | "57bb0deb", 25 | "d38fbc9f", 26 | "77e9bd2", 27 | "67423e0a", 28 | "724592dc", 29 | "1f4770e5", 30 | "59901556" 31 | ] 32 | }, 33 | "targets": { 34 | "zh-CN": [ 35 | "77da26a5", 36 | "bfcc6263", 37 | "2a7816d0", 38 | "c64b8fe5", 39 | "3a89f1f3", 40 | "b75b4336", 41 | "eba7f88c", 42 | "78384cad", 43 | "232c22ff", 44 | "fcd53b04", 45 | "721b4c55", 46 | "5002c978", 47 | "15dbbe0e", 48 | "574e1196", 49 | "ab6406bb", 50 | "57bb0deb", 51 | "d38fbc9f", 52 | "77e9bd2", 53 | "67423e0a", 54 | "724592dc", 55 | "1f4770e5", 56 | "59901556" 57 | ] 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /questions/what-is-the-usememo-hook-in-react-and-when-should-it-be-used/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "fd87a65f" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "3f062a33", 11 | "b10ffe95", 12 | "2a7816d0", 13 | "30bbd593", 14 | "220f5e6d", 15 | "21b7502a", 16 | "eea083fa", 17 | "eb89d2b3", 18 | "b10ffe95", 19 | "60132214", 20 | "29193748", 21 | "d34e9197", 22 | "7e34dff6", 23 | "29a37296", 24 | "e16a821b", 25 | "7f517bbe", 26 | "244c6bca", 27 | "4ab2c29f", 28 | "ec2dc26b", 29 | "1f4770e5", 30 | "ac742655" 31 | ] 32 | }, 33 | "targets": { 34 | "zh-CN": [ 35 | "77da26a5", 36 | "3f062a33", 37 | "b10ffe95", 38 | "2a7816d0", 39 | "30bbd593", 40 | "220f5e6d", 41 | "21b7502a", 42 | "eea083fa", 43 | "eb89d2b3", 44 | "b10ffe95", 45 | "60132214", 46 | "29193748", 47 | "d34e9197", 48 | "7e34dff6", 49 | "29a37296", 50 | "e16a821b", 51 | "7f517bbe", 52 | "244c6bca", 53 | "4ab2c29f", 54 | "ec2dc26b", 55 | "1f4770e5", 56 | "ac742655" 57 | ] 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /questions/explain-server-side-rendering-of-react-applications-and-its-benefits/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "37afa3e3" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "6a72a7b0", 11 | "2a7816d0", 12 | "efa46a08", 13 | "25841bc3", 14 | "66abf5fd", 15 | "4e8ede6c", 16 | "43069d97", 17 | "4ef53dec", 18 | "e6f2ba5a", 19 | "80a31f50", 20 | "474b69f9", 21 | "4ebf4dcc", 22 | "ced6ae25", 23 | "26104a22", 24 | "45bdfffe", 25 | "71c88e09", 26 | "264e4c2c", 27 | "4fddd280", 28 | "7e9fbf0a", 29 | "1f4770e5", 30 | "a7a5cfdf" 31 | ] 32 | }, 33 | "targets": { 34 | "zh-CN": [ 35 | "77da26a5", 36 | "6a72a7b0", 37 | "2a7816d0", 38 | "efa46a08", 39 | "25841bc3", 40 | "66abf5fd", 41 | "4e8ede6c", 42 | "43069d97", 43 | "4ef53dec", 44 | "e6f2ba5a", 45 | "80a31f50", 46 | "474b69f9", 47 | "4ebf4dcc", 48 | "ced6ae25", 49 | "26104a22", 50 | "45bdfffe", 51 | "71c88e09", 52 | "264e4c2c", 53 | "4fddd280", 54 | "7e9fbf0a", 55 | "1f4770e5", 56 | "a7a5cfdf" 57 | ] 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /questions/what-are-react-portals-used-for/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "db50555c" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "34d72af8", 11 | "2a7816d0", 12 | "10faed59", 13 | "83283a80", 14 | "6de639f4", 15 | "6dd3b324", 16 | "57777aa2", 17 | "5b45d0e9", 18 | "a6674be9", 19 | "ef6c8f0a", 20 | "4fe146f2", 21 | "1d7120f1", 22 | "4db551a7", 23 | "a883cfb4", 24 | "34a0cd30", 25 | "d2fa5dbf", 26 | "7a8194ce", 27 | "560adfa9", 28 | "2819c383", 29 | "a6f17ea9", 30 | "1f4770e5", 31 | "6637c03a" 32 | ] 33 | }, 34 | "targets": { 35 | "zh-CN": [ 36 | "77da26a5", 37 | "34d72af8", 38 | "2a7816d0", 39 | "10faed59", 40 | "83283a80", 41 | "6de639f4", 42 | "6dd3b324", 43 | "57777aa2", 44 | "5b45d0e9", 45 | "a6674be9", 46 | "ef6c8f0a", 47 | "4fe146f2", 48 | "1d7120f1", 49 | "4db551a7", 50 | "a883cfb4", 51 | "34a0cd30", 52 | "d2fa5dbf", 53 | "7a8194ce", 54 | "560adfa9", 55 | "2819c383", 56 | "a6f17ea9", 57 | "1f4770e5", 58 | "6637c03a" 59 | ] 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /questions/explain-static-generation-of-react-applications-and-its-benefits/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "17b3b8ce" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "2d11528a", 11 | "2a7816d0", 12 | "669c4f4e", 13 | "4fff29f", 14 | "f58033a", 15 | "db71e64", 16 | "36b185d3", 17 | "10cb0bd1", 18 | "905cf287", 19 | "8673c68", 20 | "357266f3", 21 | "65de325c", 22 | "3808017f", 23 | "4351478", 24 | "f9fe0b22", 25 | "dc4b812c", 26 | "74adc395", 27 | "eacab160", 28 | "8cc0201c", 29 | "6e0b9e77", 30 | "1f4770e5", 31 | "92d795c7" 32 | ] 33 | }, 34 | "targets": { 35 | "zh-CN": [ 36 | "77da26a5", 37 | "2d11528a", 38 | "2a7816d0", 39 | "669c4f4e", 40 | "4fff29f", 41 | "f58033a", 42 | "db71e64", 43 | "36b185d3", 44 | "10cb0bd1", 45 | "905cf287", 46 | "8673c68", 47 | "357266f3", 48 | "65de325c", 49 | "3808017f", 50 | "4351478", 51 | "f9fe0b22", 52 | "dc4b812c", 53 | "74adc395", 54 | "eacab160", 55 | "8cc0201c", 56 | "6e0b9e77", 57 | "1f4770e5", 58 | "92d795c7" 59 | ] 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /questions/what-is-react-fiber-and-how-is-it-an-improvement-over-the-previous-approach/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "406130b7" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "1c475dbb", 11 | "2a7816d0", 12 | "adf819a8", 13 | "1fdd52c4", 14 | "b6180576", 15 | "415d9baa", 16 | "e76737be", 17 | "1a49e04b", 18 | "76ba3fe1", 19 | "af1f937", 20 | "e43f1483", 21 | "ce619ae4", 22 | "262fc2d", 23 | "75d28be1", 24 | "29c01477", 25 | "151b2625", 26 | "4ef53dec", 27 | "1c87a8f8", 28 | "455929ce", 29 | "f5a508dd", 30 | "1f4770e5", 31 | "51b6137a" 32 | ] 33 | }, 34 | "targets": { 35 | "zh-CN": [ 36 | "77da26a5", 37 | "1c475dbb", 38 | "2a7816d0", 39 | "adf819a8", 40 | "1fdd52c4", 41 | "b6180576", 42 | "415d9baa", 43 | "e76737be", 44 | "1a49e04b", 45 | "76ba3fe1", 46 | "af1f937", 47 | "e43f1483", 48 | "ce619ae4", 49 | "262fc2d", 50 | "75d28be1", 51 | "29c01477", 52 | "151b2625", 53 | "4ef53dec", 54 | "1c87a8f8", 55 | "455929ce", 56 | "f5a508dd", 57 | "1f4770e5", 58 | "51b6137a" 59 | ] 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /questions/why-does-react-recommend-against-mutating-state/zh-CN.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 为什么 React 建议不要修改状态? 3 | --- 4 | 5 | ## TL;DR 6 | 7 | React 建议不要修改状态,因为它可能导致意外行为和错误。React 依赖于状态不变性来有效地确定何时重新渲染组件。当状态被直接修改时,React 可能无法检测到更改,从而导致过时或不正确的 UI 更新。相反,请始终使用 `setState` 或 `useState` 钩子等方法创建一个新的状态对象。 8 | 9 | *** 10 | 11 | ## 为什么 React 建议不要修改状态? 12 | 13 | ### React 的渲染机制 14 | 15 | React 使用虚拟 DOM 来优化渲染。当状态改变时,React 将新的虚拟 DOM 与之前的虚拟 DOM 进行比较,以确定更新实际 DOM 所需的最小更改集。此过程称为协调。 16 | 17 | ### 不变性和状态比较 18 | 19 | React 依赖于不变性来有效地检测更改。当状态是不可变的,React 可以通过比较引用来快速确定组件是否需要重新渲染。如果引用不同,React 知道状态已更改。 20 | 21 | ### 修改状态的问题 22 | 23 | 1. **过时的 UI 更新**:直接修改状态可能导致 React 无法检测到更改,从而导致 UI 未按预期更新。 24 | 2. **调试困难**:直接修改状态会使跟踪状态更改和调试问题变得更加困难。 25 | 3. **意外行为**:修改状态可能导致不可预测的行为,尤其是在多个组件依赖于同一状态时。 26 | 27 | ### 如何正确更新状态 28 | 29 | 不要直接修改状态,而是始终创建一个新的状态对象。例如,当使用 `useState` 钩子时: 30 | 31 | ```javascript 32 | const [state, setState] = useState(initialState); 33 | 34 | // 错误:直接修改状态 35 | state.value = newValue; 36 | 37 | // 正确:创建一个新的状态对象 38 | setState({ ...state, value: newValue }); 39 | ``` 40 | 41 | 当使用类组件和 `setState` 时: 42 | 43 | ```javascript 44 | this.setState((prevState) => ({ 45 | ...prevState, 46 | value: newValue, 47 | })); 48 | ``` 49 | 50 | ## 延伸阅读 51 | 52 | * [React documentation on state](https://react.dev/learn/state-a-components-memory) 53 | * [React documentation on reconciliation](https://react.dev/learn/preserving-and-resetting-state) 54 | * [Why not to mutate state in React](https://daveceddia.com/why-not-modify-react-state-directly/) 55 | -------------------------------------------------------------------------------- /questions/how-do-you-decide-between-using-react-state-context-and-external-state-managers/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "3a2c89da" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "3459d0d8", 11 | "2a7816d0", 12 | "3b749c9f", 13 | "3192d2e1", 14 | "b1902634", 15 | "eb315a7b", 16 | "1bdd205f", 17 | "748ffe75", 18 | "62c52617", 19 | "4f8986d7", 20 | "41a97c7b", 21 | "b066fc58", 22 | "53b97fdb", 23 | "748ffe75", 24 | "91016b4b", 25 | "8a9ad5e5", 26 | "3fd22f1d", 27 | "7c33f40a", 28 | "996a41e2", 29 | "e2b36f0b", 30 | "8d62a5c5", 31 | "1f4770e5", 32 | "42c2150d" 33 | ] 34 | }, 35 | "targets": { 36 | "zh-CN": [ 37 | "77da26a5", 38 | "3459d0d8", 39 | "2a7816d0", 40 | "3b749c9f", 41 | "3192d2e1", 42 | "b1902634", 43 | "eb315a7b", 44 | "1bdd205f", 45 | "748ffe75", 46 | "62c52617", 47 | "4f8986d7", 48 | "41a97c7b", 49 | "b066fc58", 50 | "53b97fdb", 51 | "748ffe75", 52 | "91016b4b", 53 | "8a9ad5e5", 54 | "3fd22f1d", 55 | "7c33f40a", 56 | "996a41e2", 57 | "e2b36f0b", 58 | "8d62a5c5", 59 | "1f4770e5", 60 | "42c2150d" 61 | ] 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /questions/what-are-some-react-anti-patterns/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "f887e833" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "3276d39", 11 | "4efde3fa", 12 | "2a7816d0", 13 | "9dd07882", 14 | "208b46a6", 15 | "6836d054", 16 | "26021bc8", 17 | "a5d10b50", 18 | "6cc42412", 19 | "a85eae6e", 20 | "2979e59e", 21 | "844a4a17", 22 | "825a913", 23 | "ae5d2e7f", 24 | "624979e4", 25 | "56ac0442", 26 | "8067c72", 27 | "d4009f5", 28 | "958cf747", 29 | "932bf6f2", 30 | "4d6a678e", 31 | "981c9c8c", 32 | "1f4770e5", 33 | "62d5eaf3" 34 | ] 35 | }, 36 | "targets": { 37 | "zh-CN": [ 38 | "77da26a5", 39 | "3276d39", 40 | "4efde3fa", 41 | "2a7816d0", 42 | "9dd07882", 43 | "208b46a6", 44 | "6836d054", 45 | "26021bc8", 46 | "a5d10b50", 47 | "6cc42412", 48 | "a85eae6e", 49 | "2979e59e", 50 | "844a4a17", 51 | "825a913", 52 | "ae5d2e7f", 53 | "624979e4", 54 | "56ac0442", 55 | "8067c72", 56 | "d4009f5", 57 | "958cf747", 58 | "932bf6f2", 59 | "4d6a678e", 60 | "981c9c8c", 61 | "1f4770e5", 62 | "62d5eaf3" 63 | ] 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /questions/how-do-you-debug-react-applications/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "b02467cf" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "48511126", 11 | "2a7816d0", 12 | "10a2ab60", 13 | "aecb7a44", 14 | "ffc2648", 15 | "2a5e2351", 16 | "aa5da455", 17 | "fb8d1004", 18 | "61a47d53", 19 | "d179df37", 20 | "71186e16", 21 | "d43999e0", 22 | "d70f5918", 23 | "5ea0fbf", 24 | "1741360c", 25 | "4383249f", 26 | "824424e3", 27 | "4e6feb2c", 28 | "b7ef1382", 29 | "43dc61db", 30 | "29b74665", 31 | "6663cd19", 32 | "1f4770e5", 33 | "1c865358" 34 | ] 35 | }, 36 | "targets": { 37 | "zh-CN": [ 38 | "77da26a5", 39 | "48511126", 40 | "2a7816d0", 41 | "10a2ab60", 42 | "aecb7a44", 43 | "ffc2648", 44 | "2a5e2351", 45 | "aa5da455", 46 | "fb8d1004", 47 | "61a47d53", 48 | "d179df37", 49 | "71186e16", 50 | "d43999e0", 51 | "d70f5918", 52 | "5ea0fbf", 53 | "1741360c", 54 | "4383249f", 55 | "824424e3", 56 | "4e6feb2c", 57 | "b7ef1382", 58 | "43dc61db", 59 | "29b74665", 60 | "6663cd19", 61 | "1f4770e5", 62 | "1c865358" 63 | ] 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /questions/what-is-the-useref-hook-in-react-and-when-should-it-be-used/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "f217f37" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "66ae3b53", 11 | "11431816", 12 | "2a7816d0", 13 | "addb65f5", 14 | "8774649e", 15 | "e2348f37", 16 | "e17f53cf", 17 | "f12ca507", 18 | "5beca282", 19 | "e76b9a8", 20 | "11431816", 21 | "232627bf", 22 | "46dfdc0", 23 | "c6d72b23", 24 | "e76b9a8", 25 | "c24e839d", 26 | "9c67f48", 27 | "a95809e4", 28 | "d5dac2", 29 | "e76b9a8", 30 | "a675fc16", 31 | "87e73480", 32 | "1f4770e5", 33 | "31d6aeb9" 34 | ] 35 | }, 36 | "targets": { 37 | "zh-CN": [ 38 | "77da26a5", 39 | "66ae3b53", 40 | "11431816", 41 | "2a7816d0", 42 | "addb65f5", 43 | "8774649e", 44 | "e2348f37", 45 | "e17f53cf", 46 | "f12ca507", 47 | "5beca282", 48 | "e76b9a8", 49 | "11431816", 50 | "232627bf", 51 | "46dfdc0", 52 | "c6d72b23", 53 | "e76b9a8", 54 | "c24e839d", 55 | "9c67f48", 56 | "a95809e4", 57 | "d5dac2", 58 | "e76b9a8", 59 | "a675fc16", 60 | "87e73480", 61 | "1f4770e5", 62 | "31d6aeb9" 63 | ] 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /questions/how-does-virtual-dom-in-react-work-what-are-its-benefits-and-downsides/en-US.langnostic.json: -------------------------------------------------------------------------------- 1 | { 2 | "frontmatter": { 3 | "title": "f993a423" 4 | }, 5 | "content": { 6 | "source": { 7 | "locale": "en-US", 8 | "hashes": [ 9 | "77da26a5", 10 | "38030f67", 11 | "2a7816d0", 12 | "f1c83909", 13 | "3bd3660a", 14 | "ac0e5035", 15 | "46caa831", 16 | "fe2415aa", 17 | "4ef53dec", 18 | "3d21b886", 19 | "80e2f77a", 20 | "9d82f0c5", 21 | "a1c5ce2c", 22 | "7fa677f5", 23 | "407204b4", 24 | "16705b6a", 25 | "a086cf3a", 26 | "ec8042bf", 27 | "88b7708b", 28 | "d8618f31", 29 | "90fc0672", 30 | "cd8ca69a", 31 | "c1949f5c", 32 | "1f4770e5", 33 | "bed3c648" 34 | ] 35 | }, 36 | "targets": { 37 | "zh-CN": [ 38 | "77da26a5", 39 | "38030f67", 40 | "2a7816d0", 41 | "f1c83909", 42 | "3bd3660a", 43 | "ac0e5035", 44 | "46caa831", 45 | "fe2415aa", 46 | "4ef53dec", 47 | "3d21b886", 48 | "80e2f77a", 49 | "9d82f0c5", 50 | "a1c5ce2c", 51 | "7fa677f5", 52 | "407204b4", 53 | "16705b6a", 54 | "a086cf3a", 55 | "ec8042bf", 56 | "88b7708b", 57 | "d8618f31", 58 | "90fc0672", 59 | "cd8ca69a", 60 | "c1949f5c", 61 | "1f4770e5", 62 | "bed3c648" 63 | ] 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /questions/what-is-virtual-dom-in-react/zh-CN.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: React 中的虚拟 DOM 是什么? 3 | --- 4 | 5 | ## TL;DR 6 | 7 | React 中的虚拟 DOM 是实际 DOM 的轻量级副本。它允许 React 通过比较虚拟 DOM 和真实 DOM 并仅进行必要的更改来有效地更新 UI。此过程称为协调。通过使用虚拟 DOM,React 最小化了对真实 DOM 的直接操作,这可能很慢且效率低下。 8 | 9 | *** 10 | 11 | ## React 中的虚拟 DOM 是什么? 12 | 13 | ### 简介 14 | 15 | 虚拟 DOM 是 React 等库实现的一个概念,用于提高 Web 应用程序的性能。它是一个编程概念,其中 UI 的虚拟表示保存在内存中,并通过 ReactDOM 等库与真实 DOM 同步。 16 | 17 | ### 工作原理 18 | 19 | 1. **初始渲染**:首次渲染 React 组件时,会创建一个虚拟 DOM 树。此树是实际 DOM 的轻量级副本。 20 | 2. **更新状态**:当组件的状态发生变化时,会创建一个新的虚拟 DOM 树。然后,React 将此新树与前一个树进行比较。 21 | 3. **差异算法**:React 使用差异算法来查找新虚拟 DOM 树与前一个树之间的差异。此过程称为协调。 22 | 4. **更新真实 DOM**:在确定差异后,React 仅更新已更改的真实 DOM 部分,而不是重新渲染整个 UI。 23 | 24 | ### 优点 25 | 26 | * **性能**:通过最大限度地减少对真实 DOM 的直接操作,React 可以更有效地更新 UI。 27 | * **抽象**:开发人员可以编写代码,而无需担心直接 DOM 操作的性能影响。 28 | * **可预测性**:虚拟 DOM 提供了一种可预测的方式来更新 UI,从而更容易推断应用程序的状态。 29 | 30 | ### 示例 31 | 32 | 这是一个简单的例子,说明虚拟 DOM 在 React 中的工作方式: 33 | 34 | ```jsx 35 | import React, { useState } from 'react'; 36 | 37 | function Counter() { 38 | const [count, setCount] = useState(0); 39 | 40 | return ( 41 |
You clicked {count} times
43 | 44 |` 标签内的文本。
52 |
53 | ## 延伸阅读
54 |
55 | * [React documentation on reconciliation](https://react.dev/learn/preserving-and-resetting-state)
56 | * [Understanding the virtual DOM](https://medium.com/@deathmood/how-to-write-your-own-virtual-dom-ee74acc13060)
57 |
--------------------------------------------------------------------------------
/questions/what-are-the-benefits-of-using-hooks-in-react/zh-CN.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 使用 React Hooks 有什么好处?
3 | ---
4 |
5 | ## TL;DR
6 |
7 | React 中的 Hooks 允许您使用状态和其他 React 功能,而无需编写类。它们使在组件之间重用有状态逻辑、提高代码可读性以及通过减少对生命周期方法的需求来简化代码库变得更容易。像 `useState` 和 `useEffect` 这样的 Hooks 通常用于管理函数组件中的状态和副作用。
8 |
9 | ***
10 |
11 | ## 使用 React Hooks 的好处
12 |
13 | ### 简化的状态管理
14 |
15 | 像 `useState` 这样的 Hooks 允许您将状态添加到函数组件,而无需将它们转换为类组件。这使得代码更简洁,更易于阅读。
16 |
17 | ```javascript
18 | const [count, setCount] = useState(0);
19 | ```
20 |
21 | ### 提高代码可读性
22 |
23 | Hooks 有助于将复杂的组件分解成更小、可重用的逻辑片段。这使得代码更模块化,更容易理解。
24 |
25 | ### 可重用逻辑
26 |
27 | 自定义 Hook 允许您跨多个组件提取和重用有状态逻辑。这促进了代码重用并减少了重复。
28 |
29 | ```javascript
30 | function useCustomHook() {
31 | const [state, setState] = useState(initialState);
32 | // Custom logic here
33 | return [state, setState];
34 | }
35 | ```
36 |
37 | ### 减少对生命周期方法的需求
38 |
39 | 像 `useEffect` 这样的 Hooks 可以替换生命周期方法,例如 `componentDidMount`、`componentDidUpdate` 和 `componentWillUnmount`。这简化了组件生命周期管理。
40 |
41 | ```javascript
42 | useEffect(() => {
43 | // Side effect logic here
44 | return () => {
45 | // Cleanup logic here
46 | };
47 | }, [dependencies]);
48 | ```
49 |
50 | ### 更好地关注分离
51 |
52 | Hooks 允许您通过将相关逻辑分组在一起来分离关注点。这使得代码库更易于维护和调试。
53 |
54 | ### 增强测试
55 |
56 | 与类组件相比,具有 Hooks 的函数组件通常更容易测试。Hooks 可以在隔离状态下进行测试,使单元测试更简单。
57 |
58 | ## 延伸阅读
59 |
60 | * [React Hooks documentation](https://react.dev/reference/react/hooks)
61 | * [Using the State Hook](https://react.dev/reference/react/useState)
62 | * [Using the Effect Hook](https://react.dev/reference/react/useEffect)
63 | * [Building Your Own Hooks](https://react.dev/learn/reusing-logic-with-custom-hooks)
64 |
--------------------------------------------------------------------------------
/questions/what-is-jsx-and-how-does-it-work/en-US.langnostic.json:
--------------------------------------------------------------------------------
1 | {
2 | "frontmatter": {
3 | "title": "74c167d0"
4 | },
5 | "content": {
6 | "source": {
7 | "locale": "en-US",
8 | "hashes": [
9 | "77da26a5",
10 | "4feb162b",
11 | "2a7816d0",
12 | "73f27953",
13 | "93433116",
14 | "9cb86c06",
15 | "21a03354",
16 | "b30ac0da",
17 | "af9b160d",
18 | "5d6a4f5d",
19 | "60e224d5",
20 | "dc52ddd6",
21 | "2868c456",
22 | "60e224d5",
23 | "37ccfa69",
24 | "a1588ad3",
25 | "321f112a",
26 | "a213cc6",
27 | "ba340e2e",
28 | "8fb787bf",
29 | "775b4925",
30 | "1af3a690",
31 | "5bd206ec",
32 | "c429a6f7",
33 | "3c1edc1b",
34 | "ad3f37e3",
35 | "1f4770e5",
36 | "4e74bc0b"
37 | ]
38 | },
39 | "targets": {
40 | "zh-CN": [
41 | "77da26a5",
42 | "4feb162b",
43 | "2a7816d0",
44 | "73f27953",
45 | "93433116",
46 | "9cb86c06",
47 | "21a03354",
48 | "b30ac0da",
49 | "af9b160d",
50 | "5d6a4f5d",
51 | "60e224d5",
52 | "dc52ddd6",
53 | "2868c456",
54 | "60e224d5",
55 | "37ccfa69",
56 | "a1588ad3",
57 | "321f112a",
58 | "a213cc6",
59 | "ba340e2e",
60 | "8fb787bf",
61 | "775b4925",
62 | "1af3a690",
63 | "5bd206ec",
64 | "c429a6f7",
65 | "3c1edc1b",
66 | "ad3f37e3",
67 | "1f4770e5",
68 | "4e74bc0b"
69 | ]
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/questions/how-do-you-localize-react-applications/en-US.langnostic.json:
--------------------------------------------------------------------------------
1 | {
2 | "frontmatter": {
3 | "title": "763df569"
4 | },
5 | "content": {
6 | "source": {
7 | "locale": "en-US",
8 | "hashes": [
9 | "77da26a5",
10 | "cf2aeb7b",
11 | "e7faef16",
12 | "2a7816d0",
13 | "8e19662e",
14 | "80edddd7",
15 | "b907f324",
16 | "d3e377dc",
17 | "7d98059b",
18 | "59e69ea8",
19 | "551a43b5",
20 | "3992aeb2",
21 | "40eec61d",
22 | "3b1131fc",
23 | "11996fcc",
24 | "dc2238a4",
25 | "cf7e94e0",
26 | "3cd18c66",
27 | "ff1a0479",
28 | "92b23dcb",
29 | "4e2ccbb5",
30 | "8c82b301",
31 | "31708a98",
32 | "2349edde",
33 | "71fa4ac0",
34 | "d47937eb",
35 | "1f4770e5",
36 | "e22842f9"
37 | ]
38 | },
39 | "targets": {
40 | "zh-CN": [
41 | "77da26a5",
42 | "cf2aeb7b",
43 | "e7faef16",
44 | "2a7816d0",
45 | "8e19662e",
46 | "80edddd7",
47 | "b907f324",
48 | "d3e377dc",
49 | "7d98059b",
50 | "59e69ea8",
51 | "551a43b5",
52 | "3992aeb2",
53 | "40eec61d",
54 | "3b1131fc",
55 | "11996fcc",
56 | "dc2238a4",
57 | "cf7e94e0",
58 | "3cd18c66",
59 | "ff1a0479",
60 | "92b23dcb",
61 | "4e2ccbb5",
62 | "8c82b301",
63 | "31708a98",
64 | "2349edde",
65 | "71fa4ac0",
66 | "d47937eb",
67 | "1f4770e5",
68 | "e22842f9"
69 | ]
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/questions/what-is-react-strict-mode-and-what-are-its-benefits/zh-CN.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 什么是 React 严格模式以及它有什么好处?
3 | ---
4 |
5 | ## TL;DR
6 |
7 | React 严格模式是一个开发工具,可帮助识别应用程序中的潜在问题。它为其后代激活额外的检查和警告。它不呈现任何可见的 UI,也不会影响生产构建。其好处包括识别不安全的生命周期方法、警告旧的字符串 ref API 的使用、检测意外的副作用以及确保组件能够适应未来的变化。
8 |
9 | ***
10 |
11 | ## 什么是 React 严格模式以及它有什么好处?
12 |
13 | ### 什么是 React 严格模式?
14 |
15 | React 严格模式是 React 中的一个功能,可帮助开发人员识别其应用程序中的潜在问题。它是一个包装组件,您可以使用它来包装应用程序的某些部分以启用额外的检查和警告。它不呈现任何可见的 UI,也不会影响生产构建。
16 |
17 | 要使用 React 严格模式,您可以使用 `StrictMode` 组件包装您的组件树:
18 |
19 | ```jsx
20 | import React from 'react';
21 | import ReactDOM from 'react-dom';
22 |
23 | ReactDOM.render(
24 |
{this.state.count}
52 | 53 |` 元素。 60 | 61 | ## 延伸阅读 62 | 63 | * [React documentation on reconciliation](https://react.dev/learn/preserving-and-resetting-state) 64 | * [Understanding the virtual DOM](https://www.freecodecamp.org/news/what-is-the-virtual-dom-in-react/) 65 | -------------------------------------------------------------------------------- /questions/what-is-jsx-and-how-does-it-work/zh-CN.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: 什么是JSX以及它如何工作? 3 | --- 4 | 5 | ## TL;DR 6 | 7 | JSX 代表 JavaScript XML。它是 JavaScript 的语法扩展,允许您在 JavaScript 中编写类似 HTML 的代码。JSX 通过允许您直接在 JavaScript 代码中编写类似 HTML 的内容,从而更容易创建 React 组件。在底层,JSX 被转换为 JavaScript 函数调用,通常使用 Babel 等工具。例如,JSX 中的 `
来自服务器的数据:{data}
35 |Count: {count}
45 | 46 |{count}
37 | 38 |` 元素。
44 |
45 | ## 虚拟 DOM 的好处
46 |
47 | ### 提高性能
48 |
49 | * **高效更新**:通过仅更新已更改的 DOM 部分,React 最小化了昂贵的 DOM 操作的数量。
50 | * **批量更新**:React 可以将多个更新批量处理在一起,从而减少重新渲染的次数。
51 |
52 | ### 声明式 UI
53 |
54 | * **简化开发**:开发人员可以描述 UI 在给定状态下应该是什么样子,而 React 负责更新 DOM 以匹配该状态。
55 |
56 | ### 跨平台
57 |
58 | * **React Native**:虚拟 DOM 概念允许 React 用于使用 React Native 进行移动应用程序开发,从而在不同平台上提供一致的开发体验。
59 |
60 | ## 虚拟 DOM 的缺点
61 |
62 | ### 复杂性
63 |
64 | * **学习曲线**:对于初学者来说,理解虚拟 DOM 的工作原理以及如何优化组件可能具有挑战性。
65 | * **开销**:对于非常简单的应用程序,维护虚拟 DOM 的开销可能不合理。
66 |
67 | ### 性能限制
68 |
69 | * **并非万能药**:虽然虚拟 DOM 改善了许多用例的性能,但在非常具体、高度优化的场景中,它的性能可能不如手动 DOM 操作。
70 |
71 | ## 延伸阅读
72 |
73 | * [React Docs on Reconciliation](https://react.dev/learn/render-and-commit)
74 | * [What is the Virtual DOM in React?](https://www.freecodecamp.org/news/what-is-the-virtual-dom-in-react/)
75 |
--------------------------------------------------------------------------------
/questions/what-are-some-pitfalls-about-using-context-in-react/zh-CN.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: 使用 React Context 时有哪些陷阱?
3 | ---
4 |
5 | ## TL;DR
6 |
7 | 如果管理不当,在 React 中使用 Context 可能会导致性能问题。它可能导致使用 Context 的组件不必要的重新渲染,即使它们使用的 Context 部分没有改变。此外,过度使用 Context 进行状态管理会使代码更难理解和维护。谨慎使用 Context 并考虑使用 Redux 或 Zustand 等其他状态管理解决方案来满足更复杂的状态需求非常重要。
8 |
9 | ***
10 |
11 | ## 使用 React Context 的陷阱
12 |
13 | ### 性能问题
14 |
15 | 在 React 中使用 Context 的主要陷阱之一是潜在的性能问题。当 Context 值更改时,所有使用 Context 的组件都将重新渲染,即使它们不使用已更改的 Context 部分。这可能导致不必要的重新渲染并降低应用程序的性能。
16 |
17 | #### 示例
18 |
19 | ```jsx
20 | const MyContext = React.createContext();
21 |
22 | function ParentComponent() {
23 | const [value, setValue] = React.useState(0);
24 |
25 | return (
26 |
{data.message}
58 |{data}
50 | 51 |Counter: {this.state.counter}
61 | 62 |Count: {state.count}
74 | 75 | 76 |Count: {this.state.count}
40 | 41 |Count: {count}
58 | 59 |{this.props.message}
; 84 | } 85 | } 86 | ``` 87 | 88 | 函数组件中 props 的示例: 89 | 90 | ```jsx 91 | function ParentComponent() { 92 | return{props.message}
; 97 | } 98 | ``` 99 | 100 | ### 关键区别 101 | 102 | * State 在组件内部管理,而 props 从父组件传递 103 | * State 可以随时间变化,而 props 是不可变的 104 | * State 用于组件内部变化的数据,而 props 用于向子组件传递数据和事件处理程序 105 | 106 | ## 延伸阅读 107 | 108 | * [React documentation on state](https://react.dev/learn/state-a-components-memory) 109 | * [React documentation on components and props](https://react.dev/learn/passing-props-to-a-component) 110 | * [React Hooks documentation](https://react.dev/reference/react/hooks) 111 | -------------------------------------------------------------------------------- /questions/what-are-some-react-anti-patterns/zh-CN.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: React 的一些反模式是什么? 3 | --- 4 | 5 | ## TL;DR 6 | 7 | React 反模式是指可能导致代码效率低下、难以维护或出现错误的实践。一些常见的反模式包括: 8 | 9 | * 直接改变状态,而不是使用 `setState` 10 | * 使用 `componentWillMount` 进行数据获取 11 | * 过度使用 `componentWillReceiveProps` 12 | * 在列表中不使用键 13 | * 在 render 中过度使用内联函数 14 | * 状态嵌套过深 15 | 16 | *** 17 | 18 | ## 常见的 React 反模式 19 | 20 | ### 直接改变状态 21 | 22 | 直接改变状态可能导致意外的行为和错误。 始终使用 `setState` 来更新状态。 23 | 24 | ```javascript 25 | // 反模式 26 | this.state.count = 1; 27 | 28 | // 正确方法 29 | this.setState({ count: 1 }); 30 | ``` 31 | 32 | ### 使用 `componentWillMount` 进行数据获取 33 | 34 | `componentWillMount` 已被弃用,不应用于数据获取。 请改用 `componentDidMount`。 35 | 36 | ```javascript 37 | // 反模式 38 | componentWillMount() { 39 | fetchData(); 40 | } 41 | 42 | // 正确方法 43 | componentDidMount() { 44 | fetchData(); 45 | } 46 | ``` 47 | 48 | ### 过度使用 `componentWillReceiveProps` 49 | 50 | `componentWillReceiveProps` 已被弃用。 请改用 `getDerivedStateFromProps` 或 `componentDidUpdate`。 51 | 52 | ```javascript 53 | // 反模式 54 | componentWillReceiveProps(nextProps) { 55 | if (nextProps.value !== this.props.value) { 56 | this.setState({ value: nextProps.value }); 57 | } 58 | } 59 | 60 | // 正确方法 61 | static getDerivedStateFromProps(nextProps, prevState) { 62 | if (nextProps.value !== prevState.value) { 63 | return { value: nextProps.value }; 64 | } 65 | return null; 66 | } 67 | ``` 68 | 69 | ### 在列表中不使用键 70 | 71 | 键可帮助 React 识别哪些项目已更改、已添加或已删除。 不使用键可能导致渲染效率低下。 72 | 73 | ```javascript 74 | // 反模式 75 | const listItems = items.map((item) =>You clicked {count} times
43 | 44 |` tag in the real DOM.
52 |
53 | ## Further reading
54 |
55 | - [React documentation on reconciliation](https://react.dev/learn/preserving-and-resetting-state)
56 | - [Understanding the virtual DOM](https://medium.com/@deathmood/how-to-write-your-own-virtual-dom-ee74acc13060)
57 |
--------------------------------------------------------------------------------
/questions/what-are-react-fragments-used-for/en-US.mdx:
--------------------------------------------------------------------------------
1 | ---
2 | title: What are React Fragments used for?
3 | ---
4 |
5 | ## TL;DR
6 |
7 | React Fragments are used to group multiple elements without adding extra nodes to the DOM. This is useful when you want to return multiple elements from a component's render method without wrapping them in an additional HTML element. You can use the shorthand syntax `<>...>` or the `React.Fragment` syntax.
8 |
9 | ```jsx
10 | return (
11 | <>
12 |