From ef3a7ea4c11611526ae13b8592f9a298acaaebc2 Mon Sep 17 00:00:00 2001 From: Pavel Savva Date: Tue, 19 Mar 2024 13:37:46 -0700 Subject: [PATCH 1/6] Fix typos in typescript.md (#6439) Co-authored-by: Sebastian Silbermann Co-authored-by: Allison Strandberg <55810428+allison-strandberg@users.noreply.github.com> --- src/content/learn/typescript.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/learn/typescript.md b/src/content/learn/typescript.md index c2b1a994..79546dc3 100644 --- a/src/content/learn/typescript.md +++ b/src/content/learn/typescript.md @@ -435,7 +435,7 @@ interface ModalRendererProps { Note, that you cannot use TypeScript to describe that the children are a certain type of JSX elements, so you cannot use the type-system to describe a component which only accepts `
  • ` children. -You can see all an example of both `React.ReactNode` and `React.ReactElement` with the type-checker in [this TypeScript playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgIilQ3wChSB6CxYmAOmXRgDkIATJOdNJMGAZzgwAFpxAR+8YADswAVwGkZMJFEzpOjDKw4AFHGEEBvUnDhphwADZsi0gFw0mDWjqQBuUgF9yaCNMlENzgAXjgACjADfkctFnYkfQhDAEpQgD44AB42YAA3dKMo5P46C2tbJGkvLIpcgt9-QLi3AEEwMFCItJDMrPTTbIQ3dKywdIB5aU4kKyQQKpha8drhhIGzLLWODbNs3b3s8YAxKBQAcwXpAThMaGWDvbH0gFloGbmrgQfBzYpd1YjQZbEYARkB6zMwO2SHSAAlZlYIBCdtCRkZpHIrFYahQYQD8UYYFA5EhcfjyGYqHAXnJAsIUHlOOUbHYhMIIHJzsI0Qk4P9SLUBuRqXEXEwAKKfRZcNA8PiCfxWACecAAUgBlAAacFm80W-CU11U6h4TgwUv11yShjgJjMLMqDnN9Dilq+nh8pD8AXgCHdMrCkWisVoAet0R6fXqhWKhjKllZVVxMcavpd4Zg7U6Qaj+2hmdG4zeRF10uu-Aeq0LBfLMEe-V+T2L7zLVu+FBWLdLeq+lc7DYFf39deFVOotMCACNOCh1dq219a+30uC8YWoZsRyuEdjkevR8uvoVMdjyTWt4WiSSydXD4NqZP4AymeZE072ZzuUeZQKheQgA). +You can see an example of both `React.ReactNode` and `React.ReactElement` with the type-checker in [this TypeScript playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgIilQ3wChSB6CxYmAOmXRgDkIATJOdNJMGAZzgwAFpxAR+8YADswAVwGkZMJFEzpOjDKw4AFHGEEBvUnDhphwADZsi0gFw0mDWjqQBuUgF9yaCNMlENzgAXjgACjADfkctFnYkfQhDAEpQgD44AB42YAA3dKMo5P46C2tbJGkvLIpcgt9-QLi3AEEwMFCItJDMrPTTbIQ3dKywdIB5aU4kKyQQKpha8drhhIGzLLWODbNs3b3s8YAxKBQAcwXpAThMaGWDvbH0gFloGbmrgQfBzYpd1YjQZbEYARkB6zMwO2SHSAAlZlYIBCdtCRkZpHIrFYahQYQD8UYYFA5EhcfjyGYqHAXnJAsIUHlOOUbHYhMIIHJzsI0Qk4P9SLUBuRqXEXEwAKKfRZcNA8PiCfxWACecAAUgBlAAacFm80W-CU11U6h4TgwUv11yShjgJjMLMqDnN9Dilq+nh8pD8AXgCHdMrCkWisVoAet0R6fXqhWKhjKllZVVxMcavpd4Zg7U6Qaj+2hmdG4zeRF10uu-Aeq0LBfLMEe-V+T2L7zLVu+FBWLdLeq+lc7DYFf39deFVOotMCACNOCh1dq219a+30uC8YWoZsRyuEdjkevR8uvoVMdjyTWt4WiSSydXD4NqZP4AymeZE072ZzuUeZQKheQgA). ### Style Props {/*typing-style-props*/} @@ -456,7 +456,7 @@ We recommend the following resources: - [The TypeScript handbook](https://www.typescriptlang.org/docs/handbook/) is the official documentation for TypeScript, and covers most key language features. - - [The TypeScript release notes](https://devblogs.microsoft.com/typescript/) covers a each new features in-depth. + - [The TypeScript release notes](https://devblogs.microsoft.com/typescript/) covers new features in depth. - [React TypeScript Cheatsheet](https://react-typescript-cheatsheet.netlify.app/) is a community-maintained cheatsheet for using TypeScript with React, covering a lot of useful edge cases and providing more breadth than this document. From 5a45b53b6ed4e9ee5e6777250e9253a54a89f0c1 Mon Sep 17 00:00:00 2001 From: Ricky Date: Sat, 23 Mar 2024 11:51:37 -0400 Subject: [PATCH 2/6] Fix hover styles in strictmode docs (#6705) --- src/content/reference/react/StrictMode.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/content/reference/react/StrictMode.md b/src/content/reference/react/StrictMode.md index 0b64c5ed..92c6ba63 100644 --- a/src/content/reference/react/StrictMode.md +++ b/src/content/reference/react/StrictMode.md @@ -196,6 +196,9 @@ ul { margin: 0; list-style-type: none; height: 100%; + display: flex; + flex-wrap: wrap; + padding: 10px; } li { @@ -203,7 +206,6 @@ li { border-radius: 6px; float: left; margin: 5px; - margin-bottom: 20px; padding: 5px; width: 70px; height: 100px; @@ -283,6 +285,9 @@ ul { margin: 0; list-style-type: none; height: 100%; + display: flex; + flex-wrap: wrap; + padding: 10px; } li { @@ -290,7 +295,6 @@ li { border-radius: 6px; float: left; margin: 5px; - margin-bottom: 20px; padding: 5px; width: 70px; height: 100px; @@ -377,6 +381,9 @@ ul { margin: 0; list-style-type: none; height: 100%; + display: flex; + flex-wrap: wrap; + padding: 10px; } li { @@ -384,7 +391,6 @@ li { border-radius: 6px; float: left; margin: 5px; - margin-bottom: 20px; padding: 5px; width: 70px; height: 100px; @@ -467,6 +473,9 @@ ul { margin: 0; list-style-type: none; height: 100%; + display: flex; + flex-wrap: wrap; + padding: 10px; } li { @@ -474,7 +483,6 @@ li { border-radius: 6px; float: left; margin: 5px; - margin-bottom: 20px; padding: 5px; width: 70px; height: 100px; From 9c04f9b548bb739808898d714c8091e8b131e737 Mon Sep 17 00:00:00 2001 From: Allison Strandberg <55810428+allison-strandberg@users.noreply.github.com> Date: Sat, 23 Mar 2024 15:58:26 -0400 Subject: [PATCH 3/6] Correct pluralization of 'covers' (#6702) --- src/content/learn/typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/learn/typescript.md b/src/content/learn/typescript.md index 79546dc3..6f49c765 100644 --- a/src/content/learn/typescript.md +++ b/src/content/learn/typescript.md @@ -456,7 +456,7 @@ We recommend the following resources: - [The TypeScript handbook](https://www.typescriptlang.org/docs/handbook/) is the official documentation for TypeScript, and covers most key language features. - - [The TypeScript release notes](https://devblogs.microsoft.com/typescript/) covers new features in depth. + - [The TypeScript release notes](https://devblogs.microsoft.com/typescript/) cover new features in depth. - [React TypeScript Cheatsheet](https://react-typescript-cheatsheet.netlify.app/) is a community-maintained cheatsheet for using TypeScript with React, covering a lot of useful edge cases and providing more breadth than this document. From 7bdbab144e09d4edf793ff5128080eb1dba79be4 Mon Sep 17 00:00:00 2001 From: "J.P. Anderson-Young" Date: Sun, 24 Mar 2024 07:43:33 -0700 Subject: [PATCH 4/6] Fix missing id properties in docs example (#6395) This example contains a list of person objects, but only the first 3 have id properties. This appears to be a mistake; in the next use of the list all 5 person objects have this property, but it is not changed as part of an instructive exercise. This change makes the final two with objects consistent with the remainder of the list. --- src/content/learn/rendering-lists.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/content/learn/rendering-lists.md b/src/content/learn/rendering-lists.md index 108e394e..32f81c44 100644 --- a/src/content/learn/rendering-lists.md +++ b/src/content/learn/rendering-lists.md @@ -113,9 +113,11 @@ const people = [{ name: 'Mohammad Abdus Salam', profession: 'physicist', }, { + id: 3, name: 'Percy Lavon Julian', profession: 'chemist', }, { + id: 4, name: 'Subrahmanyan Chandrasekhar', profession: 'astrophysicist', }]; From 05116c638435e5419b36f01312feae5cfaf301cd Mon Sep 17 00:00:00 2001 From: Dzmitry Zubialevich Date: Tue, 26 Mar 2024 08:37:02 +0100 Subject: [PATCH 5/6] Update rendering-lists.md --- src/content/learn/rendering-lists.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/content/learn/rendering-lists.md b/src/content/learn/rendering-lists.md index 4712b410..3002e85b 100644 --- a/src/content/learn/rendering-lists.md +++ b/src/content/learn/rendering-lists.md @@ -113,21 +113,13 @@ const people = [{ name: 'Махамад Абдус Салам', profession: 'фізік', }, { -<<<<<<< HEAD + id: 3, name: 'Персі Лавон Джуліан', profession: 'хімік', }, { + id: 4, name: 'Субрахманьян Чандрасекар', profession: 'астрафізік', -======= - id: 3, - name: 'Percy Lavon Julian', - profession: 'chemist', -}, { - id: 4, - name: 'Subrahmanyan Chandrasekhar', - profession: 'astrophysicist', ->>>>>>> 7bdbab144e09d4edf793ff5128080eb1dba79be4 }]; ``` From 289841dfdb58fd0a7c3e48ab655b9ef556bee0c3 Mon Sep 17 00:00:00 2001 From: Dzmitry Zubialevich Date: Tue, 26 Mar 2024 08:43:59 +0100 Subject: [PATCH 6/6] Update typescript.md --- src/content/learn/typescript.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/content/learn/typescript.md b/src/content/learn/typescript.md index 9df6f090..b72e4398 100644 --- a/src/content/learn/typescript.md +++ b/src/content/learn/typescript.md @@ -435,13 +435,9 @@ interface ModalRendererProps { Заўважце, што немагчыма выкарыстоўваць TypeScript для апісання нейкага пэўнага элемента JSX. То-бок вы не можаце выкарыстоўваць сістэму тыпізацыі каб апісаць кампанент, які прымае, напрыклад, толькі даччыныя элементы `
  • `. -<<<<<<< HEAD Вы можаце пабачыць прыклады абодвух тыпаў `React.ReactNode` і `React.ReactElement` з праверкай тыпаў на [гэтай тэставай пляцоўцы TypeScript](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgIilQ3wChSB6CxYmAOmXRgDkIATJOdNJMGAZzgwAFpxAR+8YADswAVwGkZMJFEzpOjDKw4AFHGEEBvUnDhphwADZsi0gFw0mDWjqQBuUgF9yaCNMlENzgAXjgACjADfkctFnYkfQhDAEpQgD44AB42YAA3dKMo5P46C2tbJGkvLIpcgt9-QLi3AEEwMFCItJDMrPTTbIQ3dKywdIB5aU4kKyQQKpha8drhhIGzLLWODbNs3b3s8YAxKBQAcwXpAThMaGWDvbH0gFloGbmrgQfBzYpd1YjQZbEYARkB6zMwO2SHSAAlZlYIBCdtCRkZpHIrFYahQYQD8UYYFA5EhcfjyGYqHAXnJAsIUHlOOUbHYhMIIHJzsI0Qk4P9SLUBuRqXEXEwAKKfRZcNA8PiCfxWACecAAUgBlAAacFm80W-CU11U6h4TgwUv11yShjgJjMLMqDnN9Dilq+nh8pD8AXgCHdMrCkWisVoAet0R6fXqhWKhjKllZVVxMcavpd4Zg7U6Qaj+2hmdG4zeRF10uu-Aeq0LBfLMEe-V+T2L7zLVu+FBWLdLeq+lc7DYFf39deFVOotMCACNOCh1dq219a+30uC8YWoZsRyuEdjkevR8uvoVMdjyTWt4WiSSydXD4NqZP4AymeZE072ZzuUeZQKheQgA). -======= -You can see an example of both `React.ReactNode` and `React.ReactElement` with the type-checker in [this TypeScript playground](https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAJQKYEMDG8BmUIjgIilQ3wChSB6CxYmAOmXRgDkIATJOdNJMGAZzgwAFpxAR+8YADswAVwGkZMJFEzpOjDKw4AFHGEEBvUnDhphwADZsi0gFw0mDWjqQBuUgF9yaCNMlENzgAXjgACjADfkctFnYkfQhDAEpQgD44AB42YAA3dKMo5P46C2tbJGkvLIpcgt9-QLi3AEEwMFCItJDMrPTTbIQ3dKywdIB5aU4kKyQQKpha8drhhIGzLLWODbNs3b3s8YAxKBQAcwXpAThMaGWDvbH0gFloGbmrgQfBzYpd1YjQZbEYARkB6zMwO2SHSAAlZlYIBCdtCRkZpHIrFYahQYQD8UYYFA5EhcfjyGYqHAXnJAsIUHlOOUbHYhMIIHJzsI0Qk4P9SLUBuRqXEXEwAKKfRZcNA8PiCfxWACecAAUgBlAAacFm80W-CU11U6h4TgwUv11yShjgJjMLMqDnN9Dilq+nh8pD8AXgCHdMrCkWisVoAet0R6fXqhWKhjKllZVVxMcavpd4Zg7U6Qaj+2hmdG4zeRF10uu-Aeq0LBfLMEe-V+T2L7zLVu+FBWLdLeq+lc7DYFf39deFVOotMCACNOCh1dq219a+30uC8YWoZsRyuEdjkevR8uvoVMdjyTWt4WiSSydXD4NqZP4AymeZE072ZzuUeZQKheQgA). ->>>>>>> 7bdbab144e09d4edf793ff5128080eb1dba79be4 -### Пропс стыляў {/*typing-style-props*/} +### Пропсы стыляў {/*typing-style-props*/} Калі вы выкарыстоўваеце ўбудаваныя стылі ў React, вы можаце выкарыстоўваць `React.CSSProperties` для апісання аб’екта, перадаваемага ў пропс `style`. Дадзены тып уключае ўсе магчымыя CSS параметры і з’яўляецца добрым спосабам пераканацца, што вы перадаяце правільны пропс `style`, і атрымаць аўтадапаўненне ў рэдактары кода. @@ -460,11 +456,7 @@ interface MyComponentProps { - [The TypeScript handbook](https://www.typescriptlang.org/docs/handbook/) — афіцыйная дакументацыя TypeScript, якая тлумачыць большасць асноўных функцый мовы. -<<<<<<< HEAD - [The TypeScript release notes](https://devblogs.microsoft.com/typescript/) падрабязна тлумачыць кожную новую функцыю. -======= - - [The TypeScript release notes](https://devblogs.microsoft.com/typescript/) cover new features in depth. ->>>>>>> 7bdbab144e09d4edf793ff5128080eb1dba79be4 - [React TypeScript Cheatsheet](https://react-typescript-cheatsheet.netlify.app/) — мадэруемая супольнасцю шпаргалка па выкарыстанні TypeScript з React, што тлумачыць шмат карысных выпадкаў і забяспечвае ахоп большы за гэтую старонку.