From b522d8941c9f33a8fcebb38021d34656d607bfe0 Mon Sep 17 00:00:00 2001 From: Lioness100 Date: Fri, 10 Feb 2023 20:52:39 -0500 Subject: [PATCH] docs: fix typos --- beta/plugins/markdownToHtml.js | 6 +++--- beta/src/components/MDX/CodeBlock/CodeBlock.tsx | 8 ++++---- beta/src/content/learn/lifecycle-of-reactive-effects.md | 8 ++++---- .../src/content/learn/passing-data-deeply-with-context.md | 4 ++-- beta/src/content/learn/removing-effect-dependencies.md | 4 ++-- .../content/reference/react-dom/components/progress.md | 2 +- beta/src/content/reference/react-dom/components/select.md | 2 +- beta/src/content/reference/react-dom/createPortal.md | 2 +- .../reference/react-dom/server/renderToPipeableStream.md | 2 +- .../reference/react-dom/server/renderToReadableStream.md | 2 +- beta/src/content/reference/react/forwardRef.md | 2 +- beta/src/content/reference/react/useContext.md | 2 +- content/blog/2013-10-3-community-roundup-9.md | 2 +- content/blog/2013-12-23-community-roundup-12.md | 2 +- content/blog/2016-04-07-react-v15.md | 2 +- content/docs/integrating-with-other-libraries.md | 2 +- examples/16-3-release-blog-post/forward-ref-example.js | 2 +- gatsby/onCreateNode.js | 2 +- .../StickyResponsiveSidebar/StickyResponsiveSidebar.js | 2 +- src/pages/acknowledgements.html.js | 4 ++-- src/utils/patchDOMForGoogleTranslate.js | 8 ++++---- 21 files changed, 35 insertions(+), 35 deletions(-) diff --git a/beta/plugins/markdownToHtml.js b/beta/plugins/markdownToHtml.js index 0d5fe7afb48..0595ed84393 100644 --- a/beta/plugins/markdownToHtml.js +++ b/beta/plugins/markdownToHtml.js @@ -2,7 +2,7 @@ const remark = require('remark'); const externalLinks = require('remark-external-links'); // Add _target and rel to external links const customHeaders = require('./remark-header-custom-ids'); // Custom header id's for i18n const images = require('remark-images'); // Improved image syntax -const unrwapImages = require('remark-unwrap-images'); // Removes

wrapper around images +const unwrapImages = require('remark-unwrap-images'); // Removes

wrapper around images const smartyPants = require('./remark-smartypants'); // Cleans up typography const html = require('remark-html'); @@ -11,7 +11,7 @@ module.exports = { externalLinks, customHeaders, images, - unrwapImages, + unwrapImages, smartyPants, ], markdownToHtml, @@ -22,7 +22,7 @@ async function markdownToHtml(markdown) { .use(externalLinks) .use(customHeaders) .use(images) - .use(unrwapImages) + .use(unwrapImages) .use(smartyPants) .use(html) .process(markdown); diff --git a/beta/src/components/MDX/CodeBlock/CodeBlock.tsx b/beta/src/components/MDX/CodeBlock/CodeBlock.tsx index dfd68056332..d73527046b2 100644 --- a/beta/src/components/MDX/CodeBlock/CodeBlock.tsx +++ b/beta/src/components/MDX/CodeBlock/CodeBlock.tsx @@ -10,7 +10,7 @@ import {css} from '@codemirror/lang-css'; import rangeParser from 'parse-numeric-range'; import {CustomTheme} from '../Sandpack/Themes'; -interface InlineHiglight { +interface InlineHighlight { step: number; line: number; startColumn: number; @@ -300,7 +300,7 @@ function getInlineDecorators( } const inlineHighlightLines = getInlineHighlights(meta, code); const inlineHighlightConfig = inlineHighlightLines.map( - (line: InlineHiglight) => ({ + (line: InlineHighlight) => ({ ...line, elementAttributes: {'data-step': `${line.step}`}, className: cn( @@ -360,8 +360,8 @@ function getInlineHighlights(meta: string, code: string) { } const lines = code.split('\n'); - const encodedHiglights = JSON.parse(parsedMeta[1]); - return encodedHiglights.map(([step, lineNo, substr, fromIndex]: any[]) => { + const encodedHighlights = JSON.parse(parsedMeta[1]); + return encodedHighlights.map(([step, lineNo, substr, fromIndex]: any[]) => { const line = lines[lineNo - 1]; let index = line.indexOf(substr); const lastIndex = line.lastIndexOf(substr); diff --git a/beta/src/content/learn/lifecycle-of-reactive-effects.md b/beta/src/content/learn/lifecycle-of-reactive-effects.md index 803e7be9efc..3fc087ff12a 100644 --- a/beta/src/content/learn/lifecycle-of-reactive-effects.md +++ b/beta/src/content/learn/lifecycle-of-reactive-effects.md @@ -1183,7 +1183,7 @@ body { -The problem with the original code was suppressing the dependency linter. If you remove the suppression, you'll see that this Effect depends on the `handleMove` function. This makes sense: `handleMove` is declared inside the component body, which makes it a reactive value. Every reactive value must be specified as a depedency, or it can potentially get stale over time! +The problem with the original code was suppressing the dependency linter. If you remove the suppression, you'll see that this Effect depends on the `handleMove` function. This makes sense: `handleMove` is declared inside the component body, which makes it a reactive value. Every reactive value must be specified as a dependency, or it can potentially get stale over time! The author of the original code has "lied" to React by saying that the Effect does not depend (`[]`) on any reactive values. This is why React did not re-synchronize the Effect after `canMove` has changed (and `handleMove` with it). Because React did not re-synchronize the Effect, the `handleMove` attached as a listener is the `handleMove` function created during the initial render. During the initial render, `canMove` was `true`, which is why `handleMove` from the initial render will forever see that value. @@ -1755,7 +1755,7 @@ async function fetchPlaces(planetId) { id: 'vishniac', name: 'Vishniac' }]); - } else throw Error('Uknown planet ID: ' + planetId); + } else throw Error('Unknown planet ID: ' + planetId); }, 1000); }); } @@ -1923,7 +1923,7 @@ async function fetchPlaces(planetId) { id: 'vishniac', name: 'Vishniac' }]); - } else throw Error('Uknown planet ID: ' + planetId); + } else throw Error('Unknown planet ID: ' + planetId); }, 1000); }); } @@ -2086,7 +2086,7 @@ async function fetchPlaces(planetId) { id: 'vishniac', name: 'Vishniac' }]); - } else throw Error('Uknown planet ID: ' + planetId); + } else throw Error('Unknown planet ID: ' + planetId); }, 1000); }); } diff --git a/beta/src/content/learn/passing-data-deeply-with-context.md b/beta/src/content/learn/passing-data-deeply-with-context.md index 5a8213d67d5..72f95304c7e 100644 --- a/beta/src/content/learn/passing-data-deeply-with-context.md +++ b/beta/src/content/learn/passing-data-deeply-with-context.md @@ -981,7 +981,7 @@ export const places = [{ }, { id: 5, name: 'Chefchaouen, Marocco', - description: 'There are a few theories on why the houses are painted blue, including that the color repells mosquitos or that it symbolizes sky and heaven.', + description: 'There are a few theories on why the houses are painted blue, including that the color repels mosquitos or that it symbolizes sky and heaven.', imageId: 'rTqKo46' }, { id: 6, @@ -1120,7 +1120,7 @@ export const places = [{ }, { id: 5, name: 'Chefchaouen, Marocco', - description: 'There are a few theories on why the houses are painted blue, including that the color repells mosquitos or that it symbolizes sky and heaven.', + description: 'There are a few theories on why the houses are painted blue, including that the color repels mosquitos or that it symbolizes sky and heaven.', imageId: 'rTqKo46' }, { id: 6, diff --git a/beta/src/content/learn/removing-effect-dependencies.md b/beta/src/content/learn/removing-effect-dependencies.md index 296eaafa8b4..f5a3bbfa0c5 100644 --- a/beta/src/content/learn/removing-effect-dependencies.md +++ b/beta/src/content/learn/removing-effect-dependencies.md @@ -1609,7 +1609,7 @@ label, button { display: block; margin-bottom: 5px; } Your Effect is re-running because it depends on the `options` object. Objects can be re-created unintentionally, you should try to avoid them as dependencies of your Effects whenever possible. -The least invasive fix is to read `roomId` and `serverUrl` right outside the Effect, and then make the Effect depend on those primitive values (which can't change unintentionally). Inside the Effect, create an object and it pass to `createConnnection`: +The least invasive fix is to read `roomId` and `serverUrl` right outside the Effect, and then make the Effect depend on those primitive values (which can't change unintentionally). Inside the Effect, create an object and it pass to `createConnection`: @@ -2045,7 +2045,7 @@ export default function ChatRoom({ roomId, createConnection, onMessage }) { Unlike the `onMessage` prop, the `onReceiveMessage` Effect Event is not reactive. This is why it doesn't need to be a dependency of your Effect. As a result, changes to `onMessage` won't cause the chat to re-connect. -You can't do the same with `createConnection` because it *should* be reactive. You *want* the Effect to re-trigger if the user switches between an encrypted and an unencryption connection, or if the user switches the current room. However, because `createConnection` is a function, you can't check whether the information it reads has *actually* changed or not. To solve this, instead of passing `createConnection` down from the `App` component, pass the raw `roomId` and `isEncrypted` values: +You can't do the same with `createConnection` because it *should* be reactive. You *want* the Effect to re-trigger if the user switches between an encrypted and an unencrypted connection, or if the user switches the current room. However, because `createConnection` is a function, you can't check whether the information it reads has *actually* changed or not. To solve this, instead of passing `createConnection` down from the `App` component, pass the raw `roomId` and `isEncrypted` values: ```js {2-3} `](http Additionally, `` supports these props: * [`max`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#attr-max): A number. Specifies the maximum `value`. Defaults to `1`. -* [`value`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#attr-value): A number between `0` and `max`, or `null` for intermedinate progress. Specifies how much was done. +* [`value`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress#attr-value): A number between `0` and `max`, or `null` for intermediate progress. Specifies how much was done. --- diff --git a/beta/src/content/reference/react-dom/components/select.md b/beta/src/content/reference/react-dom/components/select.md index de351d394df..fa153472e9b 100644 --- a/beta/src/content/reference/react-dom/components/select.md +++ b/beta/src/content/reference/react-dom/components/select.md @@ -48,7 +48,7 @@ If your `` props are relevant both for uncontrolled and controlled select boxs: +These `