@samitouri / QOS-React-2 / commits / 30b47103d4

Fix spelling errors and typos (#19138)

Ricky committed Jun 15, 2020 at 19:59 UTC 30b47103d4354d9187dc0f1fb804855a5208ca9f
73 files changed +281 -279
.github/PULL_REQUEST_TEMPLATE.md
+1 -1
@@ -12,7 +12,7 @@
12 6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
13 7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
14 8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
15 - 9. Run the [Flow](https://flowtype.org/) typechecks (`yarn flow`).
15 + 9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
16 10. If you haven't already, complete the CLA.
17
18 Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
fixtures/dom/src/components/fixtures/hydration/index.js
+1 -1
@@ -105,7 +105,7 @@ class Hydration extends React.Component {
105 Version:
106 <VersionPicker
107 id="hydration_version"
108 - name="hyration_version"
108 + name="hydration_version"
109 version={version}
110 onChange={this.setVersion}
111 />
fixtures/tracing/index.html
+1 -1
@@ -65,7 +65,7 @@
65
66 <script>
67 if (window.location.search.includes('puppeteer=true')) {
68 - // Colocated calls to performance.now() often yield different values in Puppeteer.
68 + // Collocated calls to performance.now() often yield different values in Puppeteer.
69 // This causes the Scheduler API test to fail.
70 // For the purposes of our automated release scripts,
71 // Coerce tests to use Date.now() instead to reduce the chances of a false positive.
packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
+1 -1
@@ -536,7 +536,7 @@ export default {
536 * easy. For anonymous function expressions it is much harder. If you search for
537 * `IsAnonymousFunctionDefinition()` in the ECMAScript spec you'll find places
538 * where JS gives anonymous function expressions names. We roughly detect the
539 - * same AST nodes with some exceptions to better fit our usecase.
539 + * same AST nodes with some exceptions to better fit our use case.
540 */
541
542 function getFunctionName(node) {
packages/react-devtools-core/README.md
+2 -2
@@ -21,7 +21,7 @@ Be sure to run this function *before* importing e.g. `react`, `react-dom`, `reac
21 The `config` object may contain:
22 * `host: string` (defaults to "localhost") - Websocket will connect to this host.
23 * `port: number` (defaults to `8097`) - Websocket will connect to this port.
24 -* `websocket: Websocket` - Custom websocked to use. Overrides `host` and `port` settings if provided.
24 +* `websocket: Websocket` - Custom websocket to use. Overrides `host` and `port` settings if provided.
25 * `resolveRNStyle: (style: number) => ?Object` - Used by the React Native style plug-in.
26 * `isAppActive: () => boolean` - If provided, DevTools will poll this method and wait until it returns true before connecting to React.
27
@@ -50,4 +50,4 @@ yarn start:backend
50 Watch for changes made to the standalone UI entry point and rebuild:
51 ```sh
52 yarn start:standalone
53 -```
\ No newline at end of file
53 +```
packages/react-devtools-extensions/src/renderer.js
+1 -1
@@ -1,7 +1,7 @@
1 /**
2 * In order to support reload-and-profile functionality, the renderer needs to be injected before any other scripts.
3 * Since it is a complex file (with imports) we can't just toString() it like we do with the hook itself,
4 - * So this entry point (one of the web_accessible_resources) provcides a way to eagerly inject it.
4 + * So this entry point (one of the web_accessible_resources) provides a way to eagerly inject it.
5 * The hook will look for the presence of a global __REACT_DEVTOOLS_ATTACH__ and attach an injected renderer early.
6 * The normal case (not a reload-and-profile) will not make use of this entry point though.
7 *
packages/react-devtools-inline/README.md
+3 -3
@@ -85,7 +85,7 @@ initializeBackend(contentWindow);
85
86 // React application can be injected into <iframe> at any time now...
87 // Note that this would need to be done via <script> tag injection,
88 -// as setting the src of the <iframe> would load a new page (withou the injected backend).
88 +// as setting the src of the <iframe> would load a new page (without the injected backend).
89
90 // Initialize DevTools UI to listen to the hook we just installed.
91 // This returns a React component we can render anywhere in the parent window.
@@ -107,7 +107,7 @@ Sandboxed `iframe`s are also supported but require more complex initialization.
107 ```js
108 import { activate, initialize } from "react-devtools-inline/backend";
109
110 -// The DevTooks hook needs to be installed before React is even required!
110 +// The DevTools hook needs to be installed before React is even required!
111 // The safest way to do this is probably to install it in a separate script tag.
112 initialize(window);
113
@@ -177,4 +177,4 @@ Once the above packages have been built or downloaded, you can watch for changes
177 yarn start
178 ```
179
180 -To test package changes, refer to the [`react-devtools-shell` README](https://github.com/facebook/react/blob/master/packages/react-devtools-shell/README.md).
\ No newline at end of file
180 +To test package changes, refer to the [`react-devtools-shell` README](https://github.com/facebook/react/blob/master/packages/react-devtools-shell/README.md).
packages/react-devtools-shared/src/__tests__/setupTests.js
+1 -1
@@ -21,7 +21,7 @@ env.beforeEach(() => {
21 // it's too late for a test to mock the clipboard-js modules.
22 jest.mock('clipboard-js', () => ({copy: global.mockClipboardCopy}));
23
24 - // These files should be required (and re-reuired) before each test,
24 + // These files should be required (and re-required) before each test,
25 // rather than imported at the head of the module.
26 // That's because we reset modules between tests,
27 // which disconnects the DevTool's cache from the current dispatcher ref.
packages/react-devtools-shared/src/__tests__/store-test.js
+8 -8
@@ -867,19 +867,19 @@ describe('Store', () => {
867 }
868
869 const MyComponent = (props, ref) => null;
870 - const FowardRefComponent = React.forwardRef(MyComponent);
870 + const ForwardRefComponent = React.forwardRef(MyComponent);
871 const MyComponent2 = (props, ref) => null;
872 - const FowardRefComponentWithAnonymousFunction = React.forwardRef(() => (
872 + const ForwardRefComponentWithAnonymousFunction = React.forwardRef(() => (
873 <MyComponent2 />
874 ));
875 const MyComponent3 = (props, ref) => null;
876 - const FowardRefComponentWithCustomDisplayName = React.forwardRef(
876 + const ForwardRefComponentWithCustomDisplayName = React.forwardRef(
877 MyComponent3,
878 );
879 - FowardRefComponentWithCustomDisplayName.displayName = 'Custom';
879 + ForwardRefComponentWithCustomDisplayName.displayName = 'Custom';
880 const MyComponent4 = (props, ref) => null;
881 const MemoComponent = React.memo(MyComponent4);
882 - const MemoForwardRefComponent = React.memo(FowardRefComponent);
882 + const MemoForwardRefComponent = React.memo(ForwardRefComponent);
883 const MyComponent5 = (props, ref) => null;
884 const LazyComponent = React.lazy(() => fakeImport(MyComponent5));
885
@@ -896,9 +896,9 @@ describe('Store', () => {
896 const App = () => (
897 <React.Fragment>
898 <MyComponent />
899 - <FowardRefComponent />
900 - <FowardRefComponentWithAnonymousFunction />
901 - <FowardRefComponentWithCustomDisplayName />
899 + <ForwardRefComponent />
900 + <ForwardRefComponentWithAnonymousFunction />
901 + <ForwardRefComponentWithCustomDisplayName />
902 <MemoComponent />
903 <MemoForwardRefComponent />
904 <React.Suspense fallback="Loading...">
packages/react-devtools-shared/src/__tests__/utils.js
+2 -2
@@ -41,7 +41,7 @@ export async function actAsync(
41 const {act: actTestRenderer} = require('react-test-renderer');
42 const {act: actDOM} = require('react-dom/test-utils');
43
44 - // $FlowFixMe Flow doens't know about "await act()" yet
44 + // $FlowFixMe Flow doesn't know about "await act()" yet
45 await actDOM(async () => {
46 await actTestRenderer(async () => {
47 await cb();
@@ -50,7 +50,7 @@ export async function actAsync(
50
51 if (recursivelyFlush) {
52 while (jest.getTimerCount() > 0) {
53 - // $FlowFixMe Flow doens't know about "await act()" yet
53 + // $FlowFixMe Flow doesn't know about "await act()" yet
54 await actDOM(async () => {
55 await actTestRenderer(async () => {
56 jest.runAllTimers();
packages/react-devtools-shared/src/backend/legacy/renderer.js
+5 -5
@@ -586,7 +586,7 @@ export function attach(
586 });
587 }
588
589 - function createisPathAllowed(key: string) {
589 + function createIsPathAllowed(key: string) {
590 // This function helps prevent previously-inspected paths from being dehydrated in updates.
591 // This is important to avoid a bad user experience where expanded toggles collapse on update.
592 return function isPathAllowed(path: Array<string | number>): boolean {
@@ -706,15 +706,15 @@ export function attach(
706
707 inspectedElement.context = cleanForBridge(
708 inspectedElement.context,
709 - createisPathAllowed('context'),
709 + createIsPathAllowed('context'),
710 );
711 inspectedElement.props = cleanForBridge(
712 inspectedElement.props,
713 - createisPathAllowed('props'),
713 + createIsPathAllowed('props'),
714 );
715 inspectedElement.state = cleanForBridge(
716 inspectedElement.state,
717 - createisPathAllowed('state'),
717 + createIsPathAllowed('state'),
718 );
719
720 return {
@@ -800,7 +800,7 @@ export function attach(
800 // List of owners
801 owners,
802
803 - // Location of component in source coude.
803 + // Location of component in source code.
804 source,
805
806 rootType: null,
packages/react-devtools-shared/src/backend/renderer.js
+21 -21
@@ -111,7 +111,7 @@ type ReactTypeOfSideEffectType = {|
111 Placement: number,
112 |};
113
114 -// Some environments (e.g. React Native / Hermes) don't support the performace API yet.
114 +// Some environments (e.g. React Native / Hermes) don't support the performance API yet.
115 const getCurrentTime =
116 typeof performance === 'object' && typeof performance.now === 'function'
117 ? () => performance.now()
@@ -532,7 +532,7 @@ export function attach(
532
533 // If necessary, we can revisit optimizing this operation.
534 // For example, we could add a new recursive unmount tree operation.
535 - // The unmount operations are already significantly smaller than mount opreations though.
535 + // The unmount operations are already significantly smaller than mount operations though.
536 // This is something to keep in mind for later.
537 function updateComponentFilters(componentFilters: Array<ComponentFilter>) {
538 if (isProfiling) {
@@ -551,7 +551,7 @@ export function attach(
551
552 applyComponentFilters(componentFilters);
553
554 - // Reset psuedo counters so that new path selections will be persisted.
554 + // Reset pseudo counters so that new path selections will be persisted.
555 rootDisplayNameCounter.clear();
556
557 // Recursively re-mount all roots with new filter criteria applied.
@@ -810,7 +810,7 @@ export function attach(
810
811 // Record all contexts at the time profiling is started.
812 // Fibers only store the current context value,
813 - // so we need to track them separatenly in order to determine changed keys.
813 + // so we need to track them separately in order to determine changed keys.
814 function crawlToInitializeContextsMap(fiber: Fiber) {
815 updateContextsForFiber(fiber);
816 let current = fiber.child;
@@ -961,7 +961,7 @@ export function attach(
961 // (1) an initial tree snapshot and
962 // (2) the operations array for each commit
963 // Because of this, it's important that the operations and metadata arrays align,
964 - // So it's important not to ommit even empty operations while profiing is active.
964 + // So it's important not to omit even empty operations while profiling is active.
965 if (!isProfiling) {
966 return;
967 }
@@ -1156,7 +1156,7 @@ export function attach(
1156 }
1157 const id = getFiberID(primaryFiber);
1158 if (isRoot) {
1159 - // Roots must be removed only after all children (pending and simultated) have been removed.
1159 + // Roots must be removed only after all children (pending and simulated) have been removed.
1160 // So we track it separately.
1161 pendingUnmountedRootID = id;
1162 } else if (!shouldFilterFiber(fiber)) {
@@ -1320,7 +1320,7 @@ export function attach(
1320 const {alternate} = fiber;
1321
1322 // It's important to update treeBaseDuration even if the current Fiber did not render,
1323 - // becuase it's possible that one of its descednants did.
1323 + // because it's possible that one of its descendants did.
1324 if (
1325 alternate == null ||
1326 treeBaseDuration !== alternate.treeBaseDuration
@@ -1382,7 +1382,7 @@ export function attach(
1382 // This is trickier than a simple comparison though, since certain types of fibers are filtered.
1383 const nextChildren: Array<number> = [];
1384
1385 - // This is a naive implimentation that shallowly recurses children.
1385 + // This is a naive implementation that shallowly recourses children.
1386 // We might want to revisit this if it proves to be too inefficient.
1387 let child = childSet;
1388 while (child !== null) {
@@ -1476,7 +1476,7 @@ export function attach(
1476 // Suspense components only have a non-null memoizedState if they're timed-out.
1477 const prevDidTimeout = isSuspense && prevFiber.memoizedState !== null;
1478 const nextDidTimeOut = isSuspense && nextFiber.memoizedState !== null;
1479 - // The logic below is inspired by the codepaths in updateSuspenseComponent()
1479 + // The logic below is inspired by the code paths in updateSuspenseComponent()
1480 // inside ReactFiberBeginWork in the React source code.
1481 if (prevDidTimeout && nextDidTimeOut) {
1482 // Fallback -> Fallback:
@@ -1540,7 +1540,7 @@ export function attach(
1540 }
1541 } else {
1542 // Common case: Primary -> Primary.
1543 - // This is the same codepath as for non-Suspense fibers.
1543 + // This is the same code path as for non-Suspense fibers.
1544 if (nextFiber.child !== prevFiber.child) {
1545 // If the first child is different, we need to traverse them.
1546 // Each next child will be either a new child (mount) or an alternate (update).
@@ -1596,7 +1596,7 @@ export function attach(
1596 } else {
1597 if (traceUpdatesEnabled) {
1598 // If we're tracing updates and we've bailed out before reaching a host node,
1599 - // we should fall back to recursively marking the nearest host descendates for highlight.
1599 + // we should fall back to recursively marking the nearest host descendants for highlight.
1600 if (traceNearestHostComponentUpdate) {
1601 const hostFibers = findAllCurrentHostFibers(
1602 getFiberID(getPrimaryFiber(nextFiber)),
@@ -2347,7 +2347,7 @@ export function attach(
2347 // List of owners
2348 owners,
2349
2350 - // Location of component in source coude.
2350 + // Location of component in source code.
2351 source: _debugSource || null,
2352
2353 rootType,
@@ -2380,7 +2380,7 @@ export function attach(
2380 });
2381 }
2382
2383 - function createisPathAllowed(
2383 + function createIsPathAllowed(
2384 key: string | null,
2385 secondaryCategory: 'hooks' | null,
2386 ) {
@@ -2528,7 +2528,7 @@ export function attach(
2528 ((mostRecentlyInspectedElement: any): InspectedElement),
2529 path,
2530 ),
2531 - createisPathAllowed(null, secondaryCategory),
2531 + createIsPathAllowed(null, secondaryCategory),
2532 path,
2533 ),
2534 };
@@ -2564,7 +2564,7 @@ export function attach(
2564
2565 // Any time an inspected element has an update,
2566 // we should update the selected $r value as wel.
2567 - // Do this before dehyration (cleanForBridge).
2567 + // Do this before dehydration (cleanForBridge).
2568 updateSelectedElement(mostRecentlyInspectedElement);
2569
2570 // Clone before cleaning so that we preserve the full data.
@@ -2573,19 +2573,19 @@ export function attach(
2573 const cleanedInspectedElement = {...mostRecentlyInspectedElement};
2574 cleanedInspectedElement.context = cleanForBridge(
2575 cleanedInspectedElement.context,
2576 - createisPathAllowed('context', null),
2576 + createIsPathAllowed('context', null),
2577 );
2578 cleanedInspectedElement.hooks = cleanForBridge(
2579 cleanedInspectedElement.hooks,
2580 - createisPathAllowed('hooks', 'hooks'),
2580 + createIsPathAllowed('hooks', 'hooks'),
2581 );
2582 cleanedInspectedElement.props = cleanForBridge(
2583 cleanedInspectedElement.props,
2584 - createisPathAllowed('props', null),
2584 + createIsPathAllowed('props', null),
2585 );
2586 cleanedInspectedElement.state = cleanForBridge(
2587 cleanedInspectedElement.state,
2588 - createisPathAllowed('state', null),
2588 + createIsPathAllowed('state', null),
2589 );
2590
2591 return {
@@ -2678,7 +2678,7 @@ export function attach(
2678 }
2679
2680 function setInContext(id: number, path: Array<string | number>, value: any) {
2681 - // To simplify hydration and display of primative context values (e.g. number, string)
2681 + // To simplify hydration and display of primitive context values (e.g. number, string)
2682 // the inspectElement() method wraps context in a {value: ...} object.
2683 // We need to remove the first part of the path (the "value") before continuing.
2684 path = path.slice(1);
@@ -2843,7 +2843,7 @@ export function attach(
2843 if (shouldRecordChangeDescriptions) {
2844 // Record all contexts at the time profiling is started.
2845 // Fibers only store the current context value,
2846 - // so we need to track them separatenly in order to determine changed keys.
2846 + // so we need to track them separately in order to determine changed keys.
2847 crawlToInitializeContextsMap(root.current);
2848 }
2849 });
packages/react-devtools-shared/src/backend/types.js
+1 -1
@@ -190,7 +190,7 @@ export type InspectedElement = {|
190 // Does the current renderer support editable function props?
191 canEditFunctionProps: boolean,
192
193 - // Is this Suspense, and can its value be overriden now?
193 + // Is this Suspense, and can its value be overridden now?
194 canToggleSuspense: boolean,
195
196 // Can view component source location.
packages/react-devtools-shared/src/backend/views/TraceUpdates/index.js
+1 -1
@@ -24,7 +24,7 @@ const MAX_DISPLAY_DURATION = 3000;
24 // How long should a rect be considered valid for?
25 const REMEASUREMENT_AFTER_DURATION = 250;
26
27 -// Some environments (e.g. React Native / Hermes) don't support the performace API yet.
27 +// Some environments (e.g. React Native / Hermes) don't support the performance API yet.
28 const getCurrentTime =
29 typeof performance === 'object' && typeof performance.now === 'function'
30 ? () => performance.now()
packages/react-devtools-shared/src/devtools/ContextMenu/ContextMenu.js
+2 -2
@@ -16,7 +16,7 @@ import styles from './ContextMenu.css';
16
17 import type {RegistryContextType} from './Contexts';
18
19 -function respositionToFit(element: HTMLElement, pageX: number, pageY: number) {
19 +function repositionToFit(element: HTMLElement, pageX: number, pageY: number) {
20 const ownerWindow = element.ownerDocument.defaultView;
21 if (element !== null) {
22 if (pageY + element.offsetHeight >= ownerWindow.innerHeight) {
@@ -108,7 +108,7 @@ export default function ContextMenu({children, id}: Props) {
108 const ownerWindow = ownerDocument.defaultView;
109 ownerWindow.addEventListener('resize', hide);
110
111 - respositionToFit(menu, state.pageX, state.pageY);
111 + repositionToFit(menu, state.pageX, state.pageY);
112
113 return () => {
114 ownerDocument.removeEventListener('mousedown', hideUnlessContains);
packages/react-devtools-shared/src/devtools/store.js
+1 -1
@@ -370,7 +370,7 @@ export default class Store extends EventEmitter<{|
370 return null;
371 }
372
373 - // Find wich root this element is in...
373 + // Find which root this element is in...
374 let rootID;
375 let root;
376 let rootWeight = 0;
packages/react-devtools-shared/src/devtools/views/Components/InspectedElementContext.js
+2 -2
@@ -188,7 +188,7 @@ function InspectedElementContextController({children}: Props) {
188
189 resource.write(element, inspectedElement);
190
191 - // Schedule update with React if the curently-selected element has been invalidated.
191 + // Schedule update with React if the currently-selected element has been invalidated.
192 if (id === selectedElementID) {
193 setCurrentlyInspectedElement(inspectedElement);
194 }
@@ -263,7 +263,7 @@ function InspectedElementContextController({children}: Props) {
263 } else {
264 resource.write(element, inspectedElement);
265
266 - // Schedule update with React if the curently-selected element has been invalidated.
266 + // Schedule update with React if the currently-selected element has been invalidated.
267 if (id === selectedElementID) {
268 setCurrentlyInspectedElement(inspectedElement);
269 }
packages/react-devtools-shared/src/devtools/views/Components/OwnersStack.js
+1 -1
@@ -131,7 +131,7 @@ export default function OwnerStack() {
131
132 useLayoutEffect(() => {
133 // If we're already overflowing, then we don't need to re-measure items.
134 - // That's because once the owners stack is open, it can only get larger (by driling in).
134 + // That's because once the owners stack is open, it can only get larger (by drilling in).
135 // A totally new stack can only be reached by exiting this mode and re-entering it.
136 if (elementsBarRef.current === null || isOverflowing) {
137 return () => {};
packages/react-devtools-shared/src/devtools/views/Components/SelectedElement.js
+4 -4
@@ -155,7 +155,7 @@ export default function SelectedElement(_: Props) {
155 } else {
156 const nearestSuspenseElementID = nearestSuspenseElement.id;
157
158 - // If we're suspending from an arbitary (non-Suspense) component, select the nearest Suspense element in the Tree.
158 + // If we're suspending from an arbitrary (non-Suspense) component, select the nearest Suspense element in the Tree.
159 // This way when the fallback UI is shown and the current element is hidden, something meaningful is selected.
160 if (nearestSuspenseElement !== element) {
161 dispatch({
@@ -248,7 +248,7 @@ export default function SelectedElement(_: Props) {
248 {inspectedElement !== null && (
249 <InspectedElementView
250 key={
251 - inspectedElementID /* Force reset when seleted Element changes */
251 + inspectedElementID /* Force reset when selected Element changes */
252 }
253 copyInspectedElementPath={copyInspectedElementPath}
254 element={element}
@@ -596,13 +596,13 @@ function CannotSuspendWarningMessage() {
596 filter.isEnabled,
597 );
598
599 - // Has the user filted out Suspense nodes from the tree?
599 + // Has the user filtered out Suspense nodes from the tree?
600 // If so, the selected element might actually be in a Suspense tree after all.
601 if (areSuspenseElementsHidden) {
602 return (
603 <div className={styles.CannotSuspendWarningMessage}>
604 Suspended state cannot be toggled while Suspense components are hidden.
605 - Disable the filter and try agan.
605 + Disable the filter and try again.
606 </div>
607 );
608 } else {
packages/react-devtools-shared/src/devtools/views/Components/Tree.js
+1 -1
@@ -432,7 +432,7 @@ function InnerElementType({children, style, ...rest}) {
432
433 // This ref tracks the current indentation size.
434 // We decrease indentation to fit wider/deeper trees.
435 - // We indentionally do not increase it again afterward, to avoid the perception of content "jumping"
435 + // We intentionally do not increase it again afterward, to avoid the perception of content "jumping"
436 // e.g. clicking to toggle/collapse a row might otherwise jump horizontally beneath your cursor,
437 // e.g. scrolling a wide row off screen could cause narrower rows to jump to the right some.
438 //
packages/react-devtools-shared/src/devtools/views/Components/TreeContext.js
+2 -2
@@ -13,11 +13,11 @@
13 //
14 // Changes to search state may impact tree state.
15 // For example, updating the selected search result also updates the tree's selected value.
16 -// Search does not fundamanetally change the tree though.
16 +// Search does not fundamentally change the tree though.
17 // It is also possible to update the selected tree value independently.
18 //
19 // Changes to owners state mask search and tree values.
20 -// When owners statck is not empty, search is temporarily disabnled,
20 +// When owners stack is not empty, search is temporarily disabled,
21 // and tree values (e.g. num elements, selected element) are masked.
22 // Both tree and search values are restored when the owners stack is cleared.
23 //
packages/react-devtools-shared/src/devtools/views/Components/types.js
+2 -2
@@ -17,7 +17,7 @@ import type {ElementType} from 'react-devtools-shared/src/types';
17 // Each element on the frontend corresponds to a Fiber on the backend.
18 // Some of its information (e.g. id, type, displayName) come from the backend.
19 // Other bits (e.g. weight and depth) are computed on the frontend for windowing and display purposes.
20 -// Elements are udpated on a push basis– meaning the backend pushes updates to the frontend when needed.
20 +// Elements are updated on a push basis– meaning the backend pushes updates to the frontend when needed.
21 export type Element = {|
22 id: number,
23 parentID: number,
@@ -65,7 +65,7 @@ export type InspectedElement = {|
65 // Does the current renderer support editable function props?
66 canEditFunctionProps: boolean,
67
68 - // Is this Suspense, and can its value be overriden now?
68 + // Is this Suspense, and can its value be overridden now?
69 canToggleSuspense: boolean,
70
71 // Can view component source location.
packages/react-devtools-shared/src/devtools/views/Profiler/Tooltip.js
+1 -1
@@ -81,7 +81,7 @@ function getMousePosition(
81 mouseEvent: SyntheticMouseEvent<*>,
82 ) {
83 if (relativeContainer !== null) {
84 - // Positon within the nearest position:relative container.
84 + // Position within the nearest position:relative container.
85 let targetContainer = relativeContainer;
86 while (targetContainer.parentElement != null) {
87 if (targetContainer.style.position === 'relative') {
packages/react-devtools-shared/src/devtools/views/Profiler/types.js
+1 -1
@@ -133,7 +133,7 @@ export type ProfilingDataForRootExport = {|
133 snapshots: Array<[number, SnapshotNode]>,
134 |};
135
136 -// Serializable vefrsion of ProfilingDataFrontend data.
136 +// Serializable version of ProfilingDataFrontend data.
137 export type ProfilingDataExport = {|
138 version: 4,
139 dataForRoots: Array<ProfilingDataForRootExport>,
packages/react-devtools-shell/src/app/ElementTypes/index.js
+5 -5
@@ -36,16 +36,16 @@ function FunctionComponent() {
36
37 const MemoFunctionComponent = memo(FunctionComponent);
38
39 -const FowardRefComponentWithAnonymousFunction = forwardRef((props, ref) => (
39 +const ForwardRefComponentWithAnonymousFunction = forwardRef((props, ref) => (
40 <ClassComponent ref={ref} {...props} />
41 ));
42 const ForwardRefComponent = forwardRef(function NamedInnerFunction(props, ref) {
43 return <ClassComponent ref={ref} {...props} />;
44 });
45 -const FowardRefComponentWithCustomDisplayName = forwardRef((props, ref) => (
45 +const ForwardRefComponentWithCustomDisplayName = forwardRef((props, ref) => (
46 <ClassComponent ref={ref} {...props} />
47 ));
48 -FowardRefComponentWithCustomDisplayName.displayName = 'Custom';
48 +ForwardRefComponentWithCustomDisplayName.displayName = 'Custom';
49
50 const LazyComponent = lazy(() =>
51 Promise.resolve({
@@ -66,8 +66,8 @@ export default function ElementTypes() {
66 <FunctionComponent />
67 <MemoFunctionComponent />
68 <ForwardRefComponent />
69 - <FowardRefComponentWithAnonymousFunction />
70 - <FowardRefComponentWithCustomDisplayName />
69 + <ForwardRefComponentWithAnonymousFunction />
70 + <ForwardRefComponentWithCustomDisplayName />
71 <LazyComponent />
72 </Suspense>
73 </StrictMode>
packages/react-devtools-shell/src/app/Hydration/index.js
+2 -2
@@ -11,7 +11,7 @@ import * as React from 'react';
11 import {Fragment, useDebugValue, useState} from 'react';
12
13 const div = document.createElement('div');
14 -const exmapleFunction = () => {};
14 +const exampleFunction = () => {};
15 const typedArray = new Uint8Array(3);
16 typedArray[0] = 1;
17 typedArray[1] = 2;
@@ -112,7 +112,7 @@ export default function Hydration() {
112 <h1>Hydration</h1>
113 <DehydratableProps
114 html_element={div}
115 - fn={exmapleFunction}
115 + fn={exampleFunction}
116 symbol={Symbol('symbol')}
117 react_element={<span />}
118 array_buffer={typedArray.buffer}
packages/react-devtools-shell/src/app/console.js
+1 -1
@@ -13,7 +13,7 @@ function ignoreStrings(
13 ): void {
14 // HACKY In the test harness, DevTools overrides the parent window's console.
15 // Our test app code uses the iframe's console though.
16 - // To simulate a more accurate end-ot-end ienvironment,
16 + // To simulate a more accurate end-to-end environment,
17 // the shell's console patching should pass through to the parent override methods.
18 const originalMethod = window.parent.console[methodName];
19
packages/react-dom/src/__tests__/ReactDOMFiber-test.js
+1 -1
@@ -1306,7 +1306,7 @@ describe('ReactDOMFiber', () => {
1306
1307 ReactDOM.render(<NewApp />, container);
1308
1309 - // Calling focus again will flush previously scheduled discerete work for the old root-
1309 + // Calling focus again will flush previously scheduled discrete work for the old root-
1310 // but this should not clear out the newly mounted app.
1311 ref.current.focus();
1312
packages/react-dom/src/__tests__/ReactDOMSelect-test.js
+1 -1
@@ -507,7 +507,7 @@ describe('ReactDOMSelect', () => {
507 expect(markup).not.toContain('<option selected="" value="monkey"');
508 });
509
510 - it('should not control defaultValue if readding options', () => {
510 + it('should not control defaultValue if re-adding options', () => {
511 const container = document.createElement('div');
512
513 const node = ReactDOM.render(
packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js
+2 -2
@@ -1042,7 +1042,7 @@ describe('ReactDOMServerHooks', () => {
1042
1043 return (
1044 <div>
1045 - <div aria-labelledby={id}>Chid One</div>
1045 + <div aria-labelledby={id}>Child One</div>
1046 <ChildTwo id={id} />
1047 <div aria-labelledby={idTwo}>Child Three</div>
1048 <div id={idTwo}>Child Four</div>
@@ -1336,7 +1336,7 @@ describe('ReactDOMServerHooks', () => {
1336 ).not.toBeNull();
1337 });
1338
1339 - it('useOpaqueIdentifierr: flushSync', async () => {
1339 + it('useOpaqueIdentifier: flushSync', async () => {
1340 let _setShow;
1341 function App() {
1342 const id = useOpaqueIdentifier();
packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js
+1 -1
@@ -223,7 +223,7 @@ function runActTests(label, render, unmount, rerender) {
223 expect(button.innerHTML).toBe('5');
224 });
225
226 - it("should keep flushing effects until the're done", () => {
226 + it("should keep flushing effects until they're done", () => {
227 function App() {
228 const [ctr, setCtr] = React.useState(0);
229 React.useEffect(() => {
packages/react-dom/src/__tests__/ReactTestUtilsActUnmockedScheduler-test.js
+1 -1
@@ -100,7 +100,7 @@ it('flushes effects on every call', () => {
100 expect(button.innerHTML).toEqual('5');
101 });
102
103 -it("should keep flushing effects until the're done", () => {
103 +it("should keep flushing effects until they're done", () => {
104 function App() {
105 const [ctr, setCtr] = React.useState(0);
106 React.useEffect(() => {
packages/react-dom/src/__tests__/ReactUpdates-test.js
+2 -2
@@ -26,7 +26,7 @@ describe('ReactUpdates', () => {
26 });
27
28 // Note: This is based on a similar component we use in www. We can delete
29 - // once the extra div wrapper is no longer neccessary.
29 + // once the extra div wrapper is no longer necessary.
30 function LegacyHiddenDiv({children, mode}) {
31 return (
32 <div hidden={mode === 'hidden'}>
@@ -1686,7 +1686,7 @@ describe('ReactUpdates', () => {
1686 }
1687
1688 if (__DEV__) {
1689 - it('should properly trace interactions within batched udpates', () => {
1689 + it('should properly trace interactions within batched updates', () => {
1690 const SchedulerTracing = require('scheduler/tracing');
1691
1692 let expectedInteraction;
packages/react-dom/src/client/ReactDOMEventHandle.js
+1 -1
@@ -209,7 +209,7 @@ export function createEventHandle(
209 invariant(
210 false,
211 'ReactDOM.createEventHandle: setListener called on an invalid ' +
212 - 'target. Provide a vaid EventTarget or an element managed by React.',
212 + 'target. Provide a valid EventTarget or an element managed by React.',
213 );
214 }
215 let listener = listeners.get(target);
packages/react-dom/src/client/ReactDOMHostConfig.js
+1 -1
@@ -951,7 +951,7 @@ export function didNotFindHydratableContainerSuspenseInstance(
951 parentContainer: Container,
952 ) {
953 if (__DEV__) {
954 - // TODO: warnForInsertedHydratedSupsense(parentContainer);
954 + // TODO: warnForInsertedHydratedSuspense(parentContainer);
955 }
956 }
957
packages/react-dom/src/client/ReactDOMOption.js
+2 -2
@@ -28,7 +28,7 @@ function flattenChildren(children) {
28 content += (child: any);
29 // Note: we don't warn about invalid children here.
30 // Instead, this is done separately below so that
31 - // it happens during the hydration codepath too.
31 + // it happens during the hydration code path too.
32 });
33
34 return content;
@@ -40,7 +40,7 @@ function flattenChildren(children) {
40
41 export function validateProps(element: Element, props: Object) {
42 if (__DEV__) {
43 - // This mirrors the codepath above, but runs for hydration too.
43 + // This mirrors the code path above, but runs for hydration too.
44 // Warn about invalid children here so that client and hydration are consistent.
45 // TODO: this seems like it could cause a DEV-only throw for hydration
46 // if children contains a non-element object. We should try to avoid that.
packages/react-dom/src/events/__tests__/DOMModernPluginEventSystem-test.internal.js
+57 -57
@@ -704,7 +704,7 @@ describe('DOMModernPluginEventSystem', () => {
704 it('native stopPropagation on click events between portals', () => {
705 const buttonRef = React.createRef();
706 const divRef = React.createRef();
707 - const middelDivRef = React.createRef();
707 + const middleDivRef = React.createRef();
708 const log = [];
709 const onClick = jest.fn(e => log.push(['bubble', e.currentTarget]));
710 const onClickCapture = jest.fn(e =>
@@ -716,7 +716,7 @@ describe('DOMModernPluginEventSystem', () => {
716
717 function Child() {
718 return (
719 - <div ref={middelDivRef}>
719 + <div ref={middleDivRef}>
720 <div
721 ref={divRef}
722 onClick={onClick}
@@ -731,7 +731,7 @@ describe('DOMModernPluginEventSystem', () => {
731 React.useLayoutEffect(() => {
732 // This should prevent the portalElement listeners from
733 // capturing the events in the bubble phase.
734 - middelDivRef.current.addEventListener('click', e => {
734 + middleDivRef.current.addEventListener('click', e => {
735 e.stopPropagation();
736 });
737 });
@@ -920,7 +920,7 @@ describe('DOMModernPluginEventSystem', () => {
920 it('native stopPropagation on focus events between portals', () => {
921 const buttonRef = React.createRef();
922 const divRef = React.createRef();
923 - const middelDivRef = React.createRef();
923 + const middleDivRef = React.createRef();
924 const log = [];
925 const onFocus = jest.fn(e => log.push(['bubble', e.currentTarget]));
926 const onFocusCapture = jest.fn(e =>
@@ -932,7 +932,7 @@ describe('DOMModernPluginEventSystem', () => {
932
933 function Child() {
934 return (
935 - <div ref={middelDivRef}>
935 + <div ref={middleDivRef}>
936 <div
937 ref={divRef}
938 onClick={onFocus}
@@ -948,7 +948,7 @@ describe('DOMModernPluginEventSystem', () => {
948 React.useLayoutEffect(() => {
949 // This should prevent the portalElement listeners from
950 // capturing the events in the bubble phase.
951 - middelDivRef.current.addEventListener('click', e => {
951 + middleDivRef.current.addEventListener('click', e => {
952 e.stopPropagation();
953 });
954 });
@@ -1662,7 +1662,7 @@ describe('DOMModernPluginEventSystem', () => {
1662 });
1663
1664 // @gate experimental
1665 - it('should correctly handle stopPropagation corrrectly for target events', () => {
1665 + it('should correctly handle stopPropagation correctly for target events', () => {
1666 const buttonRef = React.createRef();
1667 const divRef = React.createRef();
1668 const clickEvent = jest.fn();
@@ -1695,12 +1695,12 @@ describe('DOMModernPluginEventSystem', () => {
1695 });
1696
1697 // @gate experimental
1698 - it('should correctly handle stopPropagation corrrectly for many target events', () => {
1698 + it('should correctly handle stopPropagation correctly for many target events', () => {
1699 const buttonRef = React.createRef();
1700 - const targetListerner1 = jest.fn(e => e.stopPropagation());
1701 - const targetListerner2 = jest.fn(e => e.stopPropagation());
1702 - const targetListerner3 = jest.fn(e => e.stopPropagation());
1703 - const targetListerner4 = jest.fn(e => e.stopPropagation());
1700 + const targetListener1 = jest.fn(e => e.stopPropagation());
1701 + const targetListener2 = jest.fn(e => e.stopPropagation());
1702 + const targetListener3 = jest.fn(e => e.stopPropagation());
1703 + const targetListener4 = jest.fn(e => e.stopPropagation());
1704 const click1 = ReactDOM.unstable_createEventHandle('click');
1705 const click2 = ReactDOM.unstable_createEventHandle('click');
1706 const click3 = ReactDOM.unstable_createEventHandle('click');
@@ -1708,10 +1708,10 @@ describe('DOMModernPluginEventSystem', () => {
1708
1709 function Test() {
1710 React.useEffect(() => {
1711 - click1.setListener(buttonRef.current, targetListerner1);
1712 - click2.setListener(buttonRef.current, targetListerner2);
1713 - click3.setListener(buttonRef.current, targetListerner3);
1714 - click4.setListener(buttonRef.current, targetListerner4);
1711 + click1.setListener(buttonRef.current, targetListener1);
1712 + click2.setListener(buttonRef.current, targetListener2);
1713 + click3.setListener(buttonRef.current, targetListener3);
1714 + click4.setListener(buttonRef.current, targetListener4);
1715 });
1716
1717 return <button ref={buttonRef}>Click me!</button>;
@@ -1722,19 +1722,19 @@ describe('DOMModernPluginEventSystem', () => {
1722
1723 const buttonElement = buttonRef.current;
1724 dispatchClickEvent(buttonElement);
1725 - expect(targetListerner1).toHaveBeenCalledTimes(1);
1726 - expect(targetListerner2).toHaveBeenCalledTimes(1);
1727 - expect(targetListerner3).toHaveBeenCalledTimes(1);
1728 - expect(targetListerner4).toHaveBeenCalledTimes(1);
1725 + expect(targetListener1).toHaveBeenCalledTimes(1);
1726 + expect(targetListener2).toHaveBeenCalledTimes(1);
1727 + expect(targetListener3).toHaveBeenCalledTimes(1);
1728 + expect(targetListener4).toHaveBeenCalledTimes(1);
1729 });
1730
1731 // @gate experimental
1732 it('should correctly handle stopPropagation for mixed capture/bubbling target listeners', () => {
1733 const buttonRef = React.createRef();
1734 - const targetListerner1 = jest.fn(e => e.stopPropagation());
1735 - const targetListerner2 = jest.fn(e => e.stopPropagation());
1736 - const targetListerner3 = jest.fn(e => e.stopPropagation());
1737 - const targetListerner4 = jest.fn(e => e.stopPropagation());
1734 + const targetListener1 = jest.fn(e => e.stopPropagation());
1735 + const targetListener2 = jest.fn(e => e.stopPropagation());
1736 + const targetListener3 = jest.fn(e => e.stopPropagation());
1737 + const targetListener4 = jest.fn(e => e.stopPropagation());
1738 const click1 = ReactDOM.unstable_createEventHandle('click', {
1739 capture: true,
1740 });
@@ -1746,10 +1746,10 @@ describe('DOMModernPluginEventSystem', () => {
1746
1747 function Test() {
1748 React.useEffect(() => {
1749 - click1.setListener(buttonRef.current, targetListerner1);
1750 - click2.setListener(buttonRef.current, targetListerner2);
1751 - click3.setListener(buttonRef.current, targetListerner3);
1752 - click4.setListener(buttonRef.current, targetListerner4);
1749 + click1.setListener(buttonRef.current, targetListener1);
1750 + click2.setListener(buttonRef.current, targetListener2);
1751 + click3.setListener(buttonRef.current, targetListener3);
1752 + click4.setListener(buttonRef.current, targetListener4);
1753 });
1754
1755 return <button ref={buttonRef}>Click me!</button>;
@@ -1760,10 +1760,10 @@ describe('DOMModernPluginEventSystem', () => {
1760
1761 const buttonElement = buttonRef.current;
1762 dispatchClickEvent(buttonElement);
1763 - expect(targetListerner1).toHaveBeenCalledTimes(1);
1764 - expect(targetListerner2).toHaveBeenCalledTimes(1);
1765 - expect(targetListerner3).toHaveBeenCalledTimes(0);
1766 - expect(targetListerner4).toHaveBeenCalledTimes(0);
1763 + expect(targetListener1).toHaveBeenCalledTimes(1);
1764 + expect(targetListener2).toHaveBeenCalledTimes(1);
1765 + expect(targetListener3).toHaveBeenCalledTimes(0);
1766 + expect(targetListener4).toHaveBeenCalledTimes(0);
1767 });
1768
1769 // @gate experimental
@@ -2035,10 +2035,10 @@ describe('DOMModernPluginEventSystem', () => {
2035 // @gate experimental
2036 it('should correctly handle stopPropagation for mixed listeners', () => {
2037 const buttonRef = React.createRef();
2038 - const rootListerner1 = jest.fn(e => e.stopPropagation());
2039 - const rootListerner2 = jest.fn();
2040 - const targetListerner1 = jest.fn();
2041 - const targetListerner2 = jest.fn();
2038 + const rootListener1 = jest.fn(e => e.stopPropagation());
2039 + const rootListener2 = jest.fn();
2040 + const targetListener1 = jest.fn();
2041 + const targetListener2 = jest.fn();
2042 const click1 = ReactDOM.unstable_createEventHandle('click', {
2043 capture: true,
2044 });
@@ -2050,10 +2050,10 @@ describe('DOMModernPluginEventSystem', () => {
2050
2051 function Test() {
2052 React.useEffect(() => {
2053 - click1.setListener(window, rootListerner1);
2054 - click2.setListener(buttonRef.current, targetListerner1);
2055 - click3.setListener(window, rootListerner2);
2056 - click4.setListener(buttonRef.current, targetListerner2);
2053 + click1.setListener(window, rootListener1);
2054 + click2.setListener(buttonRef.current, targetListener1);
2055 + click3.setListener(window, rootListener2);
2056 + click4.setListener(buttonRef.current, targetListener2);
2057
2058 return () => {
2059 click1.setListener(window, null);
@@ -2069,19 +2069,19 @@ describe('DOMModernPluginEventSystem', () => {
2069
2070 const buttonElement = buttonRef.current;
2071 dispatchClickEvent(buttonElement);
2072 - expect(rootListerner1).toHaveBeenCalledTimes(1);
2073 - expect(targetListerner1).toHaveBeenCalledTimes(0);
2074 - expect(targetListerner2).toHaveBeenCalledTimes(0);
2075 - expect(rootListerner2).toHaveBeenCalledTimes(0);
2072 + expect(rootListener1).toHaveBeenCalledTimes(1);
2073 + expect(targetListener1).toHaveBeenCalledTimes(0);
2074 + expect(targetListener2).toHaveBeenCalledTimes(0);
2075 + expect(rootListener2).toHaveBeenCalledTimes(0);
2076 });
2077
2078 // @gate experimental
2079 it('should correctly handle stopPropagation for delegated listeners', () => {
2080 const buttonRef = React.createRef();
2081 - const rootListerner1 = jest.fn(e => e.stopPropagation());
2082 - const rootListerner2 = jest.fn();
2083 - const rootListerner3 = jest.fn(e => e.stopPropagation());
2084 - const rootListerner4 = jest.fn();
2081 + const rootListener1 = jest.fn(e => e.stopPropagation());
2082 + const rootListener2 = jest.fn();
2083 + const rootListener3 = jest.fn(e => e.stopPropagation());
2084 + const rootListener4 = jest.fn();
2085 const click1 = ReactDOM.unstable_createEventHandle('click', {
2086 capture: true,
2087 });
@@ -2093,10 +2093,10 @@ describe('DOMModernPluginEventSystem', () => {
2093
2094 function Test() {
2095 React.useEffect(() => {
2096 - click1.setListener(window, rootListerner1);
2097 - click2.setListener(window, rootListerner2);
2098 - click3.setListener(window, rootListerner3);
2099 - click4.setListener(window, rootListerner4);
2096 + click1.setListener(window, rootListener1);
2097 + click2.setListener(window, rootListener2);
2098 + click3.setListener(window, rootListener3);
2099 + click4.setListener(window, rootListener4);
2100
2101 return () => {
2102 click1.setListener(window, null);
@@ -2115,10 +2115,10 @@ describe('DOMModernPluginEventSystem', () => {
2115
2116 const buttonElement = buttonRef.current;
2117 dispatchClickEvent(buttonElement);
2118 - expect(rootListerner1).toHaveBeenCalledTimes(1);
2119 - expect(rootListerner2).toHaveBeenCalledTimes(1);
2120 - expect(rootListerner3).toHaveBeenCalledTimes(0);
2121 - expect(rootListerner4).toHaveBeenCalledTimes(0);
2118 + expect(rootListener1).toHaveBeenCalledTimes(1);
2119 + expect(rootListener2).toHaveBeenCalledTimes(1);
2120 + expect(rootListener3).toHaveBeenCalledTimes(0);
2121 + expect(rootListener4).toHaveBeenCalledTimes(0);
2122 });
2123
2124 // @gate experimental
@@ -2229,7 +2229,7 @@ describe('DOMModernPluginEventSystem', () => {
2229
2230 let customEventHandle;
2231
2232 - // Test that we get a warning when we don't provide an explicit priortiy
2232 + // Test that we get a warning when we don't provide an explicit priority
2233 expect(() => {
2234 customEventHandle = ReactDOM.unstable_createEventHandle(
2235 'custom-event',
packages/react-interactions/events/src/dom/__tests__/MixedResponders-test-internal.js
+1 -1
@@ -163,7 +163,7 @@ describe('mixing responders with the heritage event system', () => {
163 },
164 );
165
166 - describe('mixing the Input and Press repsonders', () => {
166 + describe('mixing the Input and Press responders', () => {
167 // @gate experimental
168 it('is async for non-input events', () => {
169 const useTap = require('react-interactions/events/tap').useTap;
packages/react-interactions/events/src/dom/__tests__/Tap-test.internal.js
+16 -16
@@ -189,8 +189,8 @@ describeWithPointerEvent('Tap responder', hasPointerEvents => {
189 expect(onTapCancel).toHaveBeenCalledTimes(0);
190 });
191
192 - // TODO: Get rid of this condition somehow. Perhaps with a dynamic verion of
193 - // the @gate pragma.
192 + // TODO: Get rid of this condition somehow. Perhaps with a dynamic version
193 + // of the @gate pragma.
194 if (__EXPERIMENTAL__) {
195 testWithPointerType('below threshold', pointerType => {
196 componentInit();
@@ -265,8 +265,8 @@ describeWithPointerEvent('Tap responder', hasPointerEvents => {
265 document.elementFromPoint = () => ref.current;
266 };
267
268 - // TODO: Get rid of this condition somehow. Perhaps with a dynamic verion of
269 - // the @gate pragma.
268 + // TODO: Get rid of this condition somehow. Perhaps with a dynamic version
269 + // of the @gate pragma.
270 if (__EXPERIMENTAL__) {
271 testWithPointerType('pointer down', pointerType => {
272 componentInit();
@@ -328,8 +328,8 @@ describeWithPointerEvent('Tap responder', hasPointerEvents => {
328 expect(onTapStart).toHaveBeenCalledTimes(1);
329 });
330
331 - // TODO: Get rid of this condition somehow. Perhaps with a dynamic verion of
332 - // the @gate pragma.
331 + // TODO: Get rid of this condition somehow. Perhaps with a dynamic version
332 + // of the @gate pragma.
333 if (__EXPERIMENTAL__) {
334 testWithPointerType('ignored buttons and modifiers', pointerType => {
335 componentInit();
@@ -416,8 +416,8 @@ describeWithPointerEvent('Tap responder', hasPointerEvents => {
416 document.elementFromPoint = () => ref.current;
417 };
418
419 - // TODO: Get rid of this condition somehow. Perhaps with a dynamic verion of
420 - // the @gate pragma.
419 + // TODO: Get rid of this condition somehow. Perhaps with a dynamic version
420 + // of the @gate pragma.
421 if (__EXPERIMENTAL__) {
422 testWithPointerType('pointer up', pointerType => {
423 componentInit();
@@ -602,8 +602,8 @@ describeWithPointerEvent('Tap responder', hasPointerEvents => {
602 document.elementFromPoint = () => ref.current;
603 };
604
605 - // TODO: Get rid of this condition somehow. Perhaps with a dynamic verion of
606 - // the @gate pragma.
605 + // TODO: Get rid of this condition somehow. Perhaps with a dynamic version
606 + // of the @gate pragma.
607 if (__EXPERIMENTAL__) {
608 testWithPointerType('requires activation', pointerType => {
609 componentInit();
@@ -726,8 +726,8 @@ describeWithPointerEvent('Tap responder', hasPointerEvents => {
726 document.elementFromPoint = () => ref.current;
727 };
728
729 - // TODO: Get rid of this condition somehow. Perhaps with a dynamic verion of
730 - // the @gate pragma.
729 + // TODO: Get rid of this condition somehow. Perhaps with a dynamic version
730 + // of the @gate pragma.
731 if (__EXPERIMENTAL__) {
732 testWithPointerType('pointer down/up', pointerType => {
733 componentInit();
@@ -789,8 +789,8 @@ describeWithPointerEvent('Tap responder', hasPointerEvents => {
789 ReactDOM.render(<Component />, container);
790 };
791
792 - // TODO: Get rid of this condition somehow. Perhaps with a dynamic verion of
793 - // the @gate pragma.
792 + // TODO: Get rid of this condition somehow. Perhaps with a dynamic version
793 + // of the @gate pragma.
794 if (__EXPERIMENTAL__) {
795 testWithPointerType('pointer cancel', pointerType => {
796 componentInit();
@@ -855,8 +855,8 @@ describeWithPointerEvent('Tap responder', hasPointerEvents => {
855 });
856 }
857
858 - // TODO: Get rid of this condition somehow. Perhaps with a dynamic verion of
859 - // the @gate pragma.
858 + // TODO: Get rid of this condition somehow. Perhaps with a dynamic version
859 + // of the @gate pragma.
860 if (__EXPERIMENTAL__) {
861 testWithPointerType('pointer move outside target', pointerType => {
862 componentInit();
packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js
+1 -1
@@ -83,7 +83,7 @@ it('fails to register the same event name with different types', () => {
83 }
84
85 // This view config has the same bubbling and direct event name
86 - // which will fail to register in developement.
86 + // which will fail to register in development.
87 return {
88 uiViewClassName: 'InvalidEvents',
89 validAttributes: {
packages/react-reconciler/src/ReactFiberDeprecatedEvents.new.js
+7 -7
@@ -94,7 +94,7 @@ function mountEventResponder(
94 function updateEventListener(
95 listener: ReactEventResponderListener<any, any>,
96 fiber: Fiber,
97 - visistedResponders: Set<ReactEventResponder<any, any>>,
97 + visitedResponders: Set<ReactEventResponder<any, any>>,
98 respondersMap: Map<
99 ReactEventResponder<any, any>,
100 ReactEventResponderInstance<any, any>,
@@ -114,7 +114,7 @@ function updateEventListener(
114 'listeners created via React.unstable_useResponder().',
115 );
116 const listenerProps = ((props: any): Object);
117 - if (visistedResponders.has(responder)) {
117 + if (visitedResponders.has(responder)) {
118 // show warning
119 if (__DEV__) {
120 console.error(
@@ -125,7 +125,7 @@ function updateEventListener(
125 }
126 return;
127 }
128 - visistedResponders.add(responder);
128 + visitedResponders.add(responder);
129 const responderInstance = respondersMap.get(responder);
130
131 if (responderInstance === undefined) {
@@ -149,7 +149,7 @@ export function updateDeprecatedEventListeners(
149 fiber: Fiber,
150 rootContainerInstance: null | Container,
151 ): void {
152 - const visistedResponders = new Set();
152 + const visitedResponders = new Set();
153 let dependencies = fiber.dependencies;
154 if (listeners != null) {
155 if (dependencies === null) {
@@ -169,7 +169,7 @@ export function updateDeprecatedEventListeners(
169 updateEventListener(
170 listener,
171 fiber,
172 - visistedResponders,
172 + visitedResponders,
173 respondersMap,
174 rootContainerInstance,
175 );
@@ -178,7 +178,7 @@ export function updateDeprecatedEventListeners(
178 updateEventListener(
179 listeners,
180 fiber,
181 - visistedResponders,
181 + visitedResponders,
182 respondersMap,
183 rootContainerInstance,
184 );
@@ -191,7 +191,7 @@ export function updateDeprecatedEventListeners(
191 const mountedResponders = Array.from(respondersMap.keys());
192 for (let i = 0, length = mountedResponders.length; i < length; i++) {
193 const mountedResponder = mountedResponders[i];
194 - if (!visistedResponders.has(mountedResponder)) {
194 + if (!visitedResponders.has(mountedResponder)) {
195 const responderInstance = ((respondersMap.get(
196 mountedResponder,
197 ): any): ReactEventResponderInstance<any, any>);
packages/react-reconciler/src/ReactFiberDeprecatedEvents.old.js
+7 -7
@@ -94,7 +94,7 @@ function mountEventResponder(
94 function updateEventListener(
95 listener: ReactEventResponderListener<any, any>,
96 fiber: Fiber,
97 - visistedResponders: Set<ReactEventResponder<any, any>>,
97 + visitedResponders: Set<ReactEventResponder<any, any>>,
98 respondersMap: Map<
99 ReactEventResponder<any, any>,
100 ReactEventResponderInstance<any, any>,
@@ -114,7 +114,7 @@ function updateEventListener(
114 'listeners created via React.unstable_useResponder().',
115 );
116 const listenerProps = ((props: any): Object);
117 - if (visistedResponders.has(responder)) {
117 + if (visitedResponders.has(responder)) {
118 // show warning
119 if (__DEV__) {
120 console.error(
@@ -125,7 +125,7 @@ function updateEventListener(
125 }
126 return;
127 }
128 - visistedResponders.add(responder);
128 + visitedResponders.add(responder);
129 const responderInstance = respondersMap.get(responder);
130
131 if (responderInstance === undefined) {
@@ -149,7 +149,7 @@ export function updateDeprecatedEventListeners(
149 fiber: Fiber,
150 rootContainerInstance: null | Container,
151 ): void {
152 - const visistedResponders = new Set();
152 + const visitedResponders = new Set();
153 let dependencies = fiber.dependencies;
154 if (listeners != null) {
155 if (dependencies === null) {
@@ -169,7 +169,7 @@ export function updateDeprecatedEventListeners(
169 updateEventListener(
170 listener,
171 fiber,
172 - visistedResponders,
172 + visitedResponders,
173 respondersMap,
174 rootContainerInstance,
175 );
@@ -178,7 +178,7 @@ export function updateDeprecatedEventListeners(
178 updateEventListener(
179 listeners,
180 fiber,
181 - visistedResponders,
181 + visitedResponders,
182 respondersMap,
183 rootContainerInstance,
184 );
@@ -191,7 +191,7 @@ export function updateDeprecatedEventListeners(
191 const mountedResponders = Array.from(respondersMap.keys());
192 for (let i = 0, length = mountedResponders.length; i < length; i++) {
193 const mountedResponder = mountedResponders[i];
194 - if (!visistedResponders.has(mountedResponder)) {
194 + if (!visitedResponders.has(mountedResponder)) {
195 const responderInstance = ((respondersMap.get(
196 mountedResponder,
197 ): any): ReactEventResponderInstance<any, any>);
packages/react-reconciler/src/ReactFiberHooks.new.js
+2 -2
@@ -925,7 +925,7 @@ function readFromUnsubcribedMutableSource<Source, Snapshot>(
925 }
926 return snapshot;
927 } else {
928 - // This handles the special case of a mutable source being shared beween renderers.
928 + // This handles the special case of a mutable source being shared between renderers.
929 // In that case, if the source is mutated between the first and second renderer,
930 // The second renderer don't know that it needs to reset the WIP version during unwind,
931 // (because the hook only marks sources as dirty if it's written to their WIP version).
@@ -1072,7 +1072,7 @@ function useMutableSource<Source, Snapshot>(
1072 // It's possible that the underlying source was mutated between the when the last "change" event fired,
1073 // and when the current render (with the new getSnapshot function) is processed.
1074 //
1075 - // In both cases, we need to throw away pending udpates (since they are no longer relevant)
1075 + // In both cases, we need to throw away pending updates (since they are no longer relevant)
1076 // and treat reading from the source as we do in the mount case.
1077 if (
1078 !is(prevGetSnapshot, getSnapshot) ||
packages/react-reconciler/src/ReactFiberHooks.old.js
+3 -3
@@ -757,7 +757,7 @@ function updateReducer<S, I, A>(
757
758 // Mark the event time of this update as relevant to this render pass.
759 // TODO: This should ideally use the true event time of this update rather than
760 - // its priority which is a derived and not reverseable value.
760 + // its priority which is a derived and not reversible value.
761 // TODO: We should skip this update if it was already committed but currently
762 // we have no way of detecting the difference between a committed and suspended
763 // update here.
@@ -925,7 +925,7 @@ function readFromUnsubcribedMutableSource<Source, Snapshot>(
925 }
926 return snapshot;
927 } else {
928 - // This handles the special case of a mutable source being shared beween renderers.
928 + // This handles the special case of a mutable source being shared between renderers.
929 // In that case, if the source is mutated between the first and second renderer,
930 // The second renderer don't know that it needs to reset the WIP version during unwind,
931 // (because the hook only marks sources as dirty if it's written to their WIP version).
@@ -1072,7 +1072,7 @@ function useMutableSource<Source, Snapshot>(
1072 // It's possible that the underlying source was mutated between the when the last "change" event fired,
1073 // and when the current render (with the new getSnapshot function) is processed.
1074 //
1075 - // In both cases, we need to throw away pending udpates (since they are no longer relevant)
1075 + // In both cases, we need to throw away pending updates (since they are no longer relevant)
1076 // and treat reading from the source as we do in the mount case.
1077 if (
1078 !is(prevGetSnapshot, getSnapshot) ||
packages/react-reconciler/src/ReactFiberNewContext.new.js
+1 -1
@@ -244,7 +244,7 @@ export function propagateContextChange(
244 enableSuspenseServerRenderer &&
245 fiber.tag === DehydratedFragment
246 ) {
247 - // If a dehydrated suspense bounudary is in this subtree, we don't know
247 + // If a dehydrated suspense boundary is in this subtree, we don't know
248 // if it will have any context consumers in it. The best we can do is
249 // mark it as having updates.
250 const parentSuspense = fiber.return;
packages/react-reconciler/src/ReactFiberNewContext.old.js
+1 -1
@@ -244,7 +244,7 @@ export function propagateContextChange(
244 enableSuspenseServerRenderer &&
245 fiber.tag === DehydratedFragment
246 ) {
247 - // If a dehydrated suspense bounudary is in this subtree, we don't know
247 + // If a dehydrated suspense boundary is in this subtree, we don't know
248 // if it will have any context consumers in it. The best we can do is
249 // mark it as having updates.
250 const parentSuspense = fiber.return;
packages/react-reconciler/src/ReactFiberReconciler.js
+2
@@ -161,6 +161,8 @@ export const createPortal = enableNewReconciler
161 export const createComponentSelector = enableNewReconciler
162 ? createComponentSelector_new
163 : createComponentSelector_old;
164 +
165 +//TODO: "psuedo" is spelled "pseudo"
166 export const createHasPsuedoClassSelector = enableNewReconciler
167 ? createHasPsuedoClassSelector_new
168 : createHasPsuedoClassSelector_old;
packages/react-reconciler/src/ReactFiberWorkLoop.new.js
+3 -3
@@ -371,7 +371,7 @@ export function requestUpdateLane(
371 // remove the special case and treat them as if they came from an
372 // interleaved event. Regardless, this pattern is not officially supported.
373 // This behavior is only a fallback. The flag only exists until we can roll
374 - // out the setState warnning, since existing code might accidentally rely on
374 + // out the setState warning, since existing code might accidentally rely on
375 // the current behavior.
376 return pickArbitraryLane(workInProgressRootRenderLanes);
377 }
@@ -383,7 +383,7 @@ export function requestUpdateLane(
383 //
384 // However, the "included" lanes could be mutated in between updates in the
385 // same event, like if you perform an update inside `flushSync`. Or any other
386 - // codepath that might call `prepareFreshStack`.
386 + // code path that might call `prepareFreshStack`.
387 //
388 // The trick we use is to cache the first of each of these inputs within an
389 // event. Then reset the cached values once we can be sure the event is over.
@@ -1273,7 +1273,7 @@ function handleError(root, thrownValue): void {
1273 // sibling, or the parent if there are no siblings. But since the root
1274 // has no siblings nor a parent, we set it to null. Usually this is
1275 // handled by `completeUnitOfWork` or `unwindWork`, but since we're
1276 - // interntionally not calling those, we need set it here.
1276 + // intentionally not calling those, we need set it here.
1277 // TODO: Consider calling `unwindWork` to pop the contexts.
1278 workInProgress = null;
1279 return;
packages/react-reconciler/src/ReactFiberWorkLoop.old.js
+2 -2
@@ -371,7 +371,7 @@ export function requestUpdateLane(
371 // remove the special case and treat them as if they came from an
372 // interleaved event. Regardless, this pattern is not officially supported.
373 // This behavior is only a fallback. The flag only exists until we can roll
374 - // out the setState warnning, since existing code might accidentally rely on
374 + // out the setState warning, since existing code might accidentally rely on
375 // the current behavior.
376 return pickArbitraryLane(workInProgressRootRenderLanes);
377 }
@@ -383,7 +383,7 @@ export function requestUpdateLane(
383 //
384 // However, the "included" lanes could be mutated in between updates in the
385 // same event, like if you perform an update inside `flushSync`. Or any other
386 - // codepath that might call `prepareFreshStack`.
386 + // code path that might call `prepareFreshStack`.
387 //
388 // The trick we use is to cache the first of each of these inputs within an
389 // event. Then reset the cached values once we can be sure the event is over.
packages/react-reconciler/src/ReactInternalTypes.js
+1 -1
@@ -205,7 +205,7 @@ type BaseFiberRootProperties = {|
205 // Node returned by Scheduler.scheduleCallback
206 callbackNode: *,
207
208 - // Used by useMutableSource hook to avoid tearing during hydrtaion.
208 + // Used by useMutableSource hook to avoid tearing during hydration.
209 mutableSourceEagerHydrationData?: Array<
210 MutableSource<any> | MutableSourceVersion,
211 > | null,
packages/react-reconciler/src/ReactStrictModeWarnings.new.js
+1 -1
@@ -64,7 +64,7 @@ if (__DEV__) {
64 fiber: Fiber,
65 instance: any,
66 ) => {
67 - // Dedup strategy: Warn once per component.
67 + // Dedupe strategy: Warn once per component.
68 if (didWarnAboutUnsafeLifecycles.has(fiber.type)) {
69 return;
70 }
packages/react-reconciler/src/ReactUpdateQueue.new.js
+1 -1
@@ -521,7 +521,7 @@ export function processUpdateQueue<State>(
521
522 // Mark the event time of this update as relevant to this render pass.
523 // TODO: This should ideally use the true event time of this update rather than
524 - // its priority which is a derived and not reverseable value.
524 + // its priority which is a derived and not reversible value.
525 // TODO: We should skip this update if it was already committed but currently
526 // we have no way of detecting the difference between a committed and suspended
527 // update here.
packages/react-reconciler/src/ReactUpdateQueue.old.js
+1 -1
@@ -521,7 +521,7 @@ export function processUpdateQueue<State>(
521
522 // Mark the event time of this update as relevant to this render pass.
523 // TODO: This should ideally use the true event time of this update rather than
524 - // its priority which is a derived and not reverseable value.
524 + // its priority which is a derived and not reversible value.
525 // TODO: We should skip this update if it was already committed but currently
526 // we have no way of detecting the difference between a committed and suspended
527 // update here.
packages/react-reconciler/src/__tests__/DebugTracing-test.internal.js
+8 -8
@@ -71,9 +71,9 @@ describe('DebugTracing', () => {
71
72 // @gate experimental && build === 'development' && enableDebugTracing
73 it('should log sync render with suspense', async () => {
74 - const fakeSuspensPromise = Promise.resolve(true);
74 + const fakeSuspensePromise = Promise.resolve(true);
75 function Example() {
76 - throw fakeSuspensPromise;
76 + throw fakeSuspensePromise;
77 }
78
79 ReactTestRenderer.create(
@@ -92,15 +92,15 @@ describe('DebugTracing', () => {
92
93 logs.splice(0);
94
95 - await fakeSuspensPromise;
95 + await fakeSuspensePromise;
96 expect(logs).toEqual(['log: ⚛️ Example resolved']);
97 });
98
99 // @gate experimental && build === 'development' && enableDebugTracing
100 it('should log concurrent render with suspense', async () => {
101 - const fakeSuspensPromise = Promise.resolve(true);
101 + const fakeSuspensePromise = Promise.resolve(true);
102 function Example() {
103 - throw fakeSuspensPromise;
103 + throw fakeSuspensePromise;
104 }
105
106 ReactTestRenderer.create(
@@ -126,7 +126,7 @@ describe('DebugTracing', () => {
126
127 logs.splice(0);
128
129 - await fakeSuspensPromise;
129 + await fakeSuspensePromise;
130 expect(logs).toEqual(['log: ⚛️ Example resolved']);
131 });
132
@@ -319,9 +319,9 @@ describe('DebugTracing', () => {
319 return didMount;
320 }
321
322 - const fakeSuspensPromise = new Promise(() => {});
322 + const fakeSuspensePromise = new Promise(() => {});
323 function ExampleThatSuspends() {
324 - throw fakeSuspensPromise;
324 + throw fakeSuspensePromise;
325 }
326
327 function Example() {
packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
+1 -1
@@ -1774,7 +1774,7 @@ describe('ReactHooksWithNoopRenderer', () => {
1774 expect(ReactNoop.getChildren()).toEqual([span('Count: (empty)')]);
1775 });
1776
1777 - // effects get fored on exiting act()
1777 + // effects get forced on exiting act()
1778 // There were multiple updates, but there should only be a
1779 // single render
1780 expect(Scheduler).toHaveYielded(['Count: 0']);
packages/react-reconciler/src/__tests__/ReactIncremental-test.js
+1 -1
@@ -25,7 +25,7 @@ describe('ReactIncremental', () => {
25 });
26
27 // Note: This is based on a similar component we use in www. We can delete
28 - // once the extra div wrapper is no longer neccessary.
28 + // once the extra div wrapper is no longer necessary.
29 function LegacyHiddenDiv({children, mode}) {
30 return (
31 <div hidden={mode === 'hidden'}>
packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js
+3 -3
@@ -46,7 +46,7 @@ describe('ReactIncrementalErrorHandling', () => {
46 }
47
48 // Note: This is based on a similar component we use in www. We can delete
49 - // once the extra div wrapper is no longer neccessary.
49 + // once the extra div wrapper is no longer necessary.
50 function LegacyHiddenDiv({children, mode}) {
51 return (
52 <div hidden={mode === 'hidden'}>
@@ -440,8 +440,8 @@ describe('ReactIncrementalErrorHandling', () => {
440 'C',
441 'D',
442
443 - // Since the error occured during a partially concurrent render, we should
444 - // retry one more time, synchonrously.
443 + // Since the error occurred during a partially concurrent render, we should
444 + // retry one more time, synchronously.
445 'A',
446 'B',
447 'Oops',
packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.js
+1 -1
@@ -39,7 +39,7 @@ describe('ReactIncrementalSideEffects', () => {
39 }
40
41 // Note: This is based on a similar component we use in www. We can delete
42 - // once the extra div wrapper is no longer neccessary.
42 + // once the extra div wrapper is no longer necessary.
43 function LegacyHiddenDiv({children, mode}) {
44 return (
45 <div hidden={mode === 'hidden'}>
packages/react-reconciler/src/__tests__/ReactNewContext-test.js
+1 -1
@@ -43,7 +43,7 @@ describe('ReactNewContext', () => {
43 }
44
45 // Note: This is based on a similar component we use in www. We can delete
46 - // once the extra div wrapper is no longer neccessary.
46 + // once the extra div wrapper is no longer necessary.
47 function LegacyHiddenDiv({children, mode}) {
48 return (
49 <div hidden={mode === 'hidden'}>
packages/react-reconciler/src/__tests__/ReactSchedulerIntegration-test.js
+2 -2
@@ -54,7 +54,7 @@ describe('ReactSchedulerIntegration', () => {
54 }
55
56 // Note: This is based on a similar component we use in www. We can delete
57 - // once the extra div wrapper is no longer neccessary.
57 + // once the extra div wrapper is no longer necessary.
58 function LegacyHiddenDiv({children, mode}) {
59 return (
60 <div hidden={mode === 'hidden'}>
@@ -500,7 +500,7 @@ describe(
500 // This test reproduces a bug where React's Scheduler task timed out but
501 // the `shouldYield` method returned true. Usually we try not to mock
502 // internal methods, but I've made an exception here since the point is
503 - // specifically to test that React is reslient to the behavior of a
503 + // specifically to test that React is resilient to the behavior of a
504 // Scheduler API. That being said, feel free to rewrite or delete this
505 // test if/when the API changes.
506 function Text({text}) {
packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js
+1 -1
@@ -141,7 +141,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
141 }
142
143 // Note: This is based on a similar component we use in www. We can delete
144 - // once the extra div wrapper is no longer neccessary.
144 + // once the extra div wrapper is no longer necessary.
145 function LegacyHiddenDiv({children, mode}) {
146 return (
147 <div hidden={mode === 'hidden'}>
packages/react-reconciler/src/__tests__/useMutableSource-test.internal.js
+7 -7
@@ -180,7 +180,7 @@ describe('useMutableSource', () => {
180 source.value = 'two';
181 expect(Scheduler).toFlushAndYieldThrough(['a:two', 'b:two']);
182
183 - // Umounting a component should remove its subscriptino.
183 + // Umounting a component should remove its subscription.
184 ReactNoop.renderToRootWithID(
185 <>
186 <Component
@@ -391,7 +391,7 @@ describe('useMutableSource', () => {
391 expect(unsubscribeA).toHaveBeenCalledTimes(1);
392 expect(subscribeB).toHaveBeenCalledTimes(1);
393
394 - // Unmounting should call the newer unsunscribe.
394 + // Unmounting should call the newer unsubscribe.
395 ReactNoop.unmountRootWithID('root');
396 expect(Scheduler).toFlushAndYield([]);
397 ReactNoop.flushPassiveEffects();
@@ -430,7 +430,7 @@ describe('useMutableSource', () => {
430 source.value = 'two';
431 expect(Scheduler).toFlushAndYieldThrough(['a:two']);
432
433 - // Re-renders that occur before the udpate is processed
433 + // Re-renders that occur before the update is processed
434 // should reuse snapshot so long as the config has not changed
435 ReactNoop.flushSync(() => {
436 ReactNoop.render(
@@ -692,7 +692,7 @@ describe('useMutableSource', () => {
692 );
693 expect(Scheduler).toFlushAndYield(['a:a:one', 'Sync effect']);
694
695 - // Because the store has not chagned yet, there are no pending updates,
695 + // Because the store has not changed yet, there are no pending updates,
696 // so it is considered safe to read from when we start this render.
697 ReactNoop.render(
698 <>
@@ -1002,7 +1002,7 @@ describe('useMutableSource', () => {
1002 });
1003
1004 // @gate experimental
1005 - it('should not warn about updates that fire between unmount and passive unsubcribe', () => {
1005 + it('should not warn about updates that fire between unmount and passive unsubscribe', () => {
1006 const source = createSource('one');
1007 const mutableSource = createMutableSource(source);
1008
@@ -1027,7 +1027,7 @@ describe('useMutableSource', () => {
1027 expect(Scheduler).toFlushAndYield(['only:one', 'Sync effect']);
1028 ReactNoop.flushPassiveEffects();
1029
1030 - // Umounting a root should remove the remaining event listeners in a passive effect
1030 + // Unmounting a root should remove the remaining event listeners in a passive effect
1031 ReactNoop.unmountRootWithID('root');
1032 expect(Scheduler).toFlushAndYieldThrough(['layout unmount']);
1033
@@ -1612,7 +1612,7 @@ describe('useMutableSource', () => {
1612 ]);
1613
1614 // Now there are two pending mutations at different priorities. But they
1615 - // both read the same verion of the mutable source, so we must render
1615 + // both read the same version of the mutable source, so we must render
1616 // them simultaneously.
1617 //
1618 expect(Scheduler).toFlushAndYieldThrough([
packages/react-refresh/src/ReactFreshBabelPlugin.js
+2 -2
@@ -307,7 +307,7 @@ export default function(babel, opts = {}) {
307 if (typeof require === 'function' && !opts.emitFullSignatures) {
308 // Prefer to hash when we can (e.g. outside of ASTExplorer).
309 // This makes it deterministically compact, even if there's
310 - // e.g. a useState ininitalizer with some code inside.
310 + // e.g. a useState initializer with some code inside.
311 // We also need it for www that has transforms like cx()
312 // that don't understand if something is part of a string.
313 finalKey = require('crypto')
@@ -537,7 +537,7 @@ export default function(babel, opts = {}) {
537
538 // Unlike with $RefreshReg$, this needs to work for nested
539 // declarations too. So we need to search for a path where
540 - // we can insert a statement rather than hardcoding it.
540 + // we can insert a statement rather than hard coding it.
541 let insertAfterPath = null;
542 path.find(p => {
543 if (p.parentPath.isBlock()) {
packages/react-refresh/src/__tests__/ReactFreshMultipleRenderer-test.internal.js
+1 -1
@@ -41,7 +41,7 @@ describe('ReactFresh', () => {
41 }
42 });
43
44 - it('can update components managd by different renderers independently', () => {
44 + it('can update components managed by different renderers independently', () => {
45 if (__DEV__) {
46 const InnerV1 = function() {
47 return <ReactART.Shape fill="blue" />;
packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.js
+1 -1
@@ -1497,7 +1497,7 @@ describe('ReactShallowRenderer', () => {
1497 const shallowRenderer = createRenderer();
1498 shallowRenderer.render(<Foo foo={1} bar={1} />);
1499 expect(renderCount).toBe(1);
1500 - // Change a prop that the comparison funciton ignores
1500 + // Change a prop that the comparison function ignores
1501 shallowRenderer.render(<Foo foo={1} bar={2} />);
1502 expect(renderCount).toBe(1);
1503 shallowRenderer.render(<Foo foo={2} bar={2} />);
packages/react/src/ReactFundamental.js
+3 -3
@@ -22,12 +22,12 @@ export function createFundamental<C, H>(
22 if (__DEV__ && !hasBadMapPolyfill) {
23 Object.freeze(impl);
24 }
25 - const fundamantalComponent = {
25 + const fundamentalComponent = {
26 $$typeof: REACT_FUNDAMENTAL_TYPE,
27 impl,
28 };
29 if (__DEV__) {
30 - Object.freeze(fundamantalComponent);
30 + Object.freeze(fundamentalComponent);
31 }
32 - return fundamantalComponent;
32 + return fundamentalComponent;
33 }
packages/react/src/__tests__/ReactDOMTracing-test.internal.js
+1 -1
@@ -56,7 +56,7 @@ function loadModules() {
56 }
57
58 // Note: This is based on a similar component we use in www. We can delete once
59 -// the extra div wrapper is no longer neccessary.
59 +// the extra div wrapper is no longer necessary.
60 function LegacyHiddenDiv({children, mode}) {
61 return (
62 <div hidden={mode === 'hidden'}>
packages/react/src/__tests__/ReactProfiler-test.internal.js
+47 -47
@@ -1282,7 +1282,7 @@ describe('Profiler', () => {
1282 it('should report time spent in layout effects and commit lifecycles', () => {
1283 const callback = jest.fn();
1284
1285 - const ComponetWithEffects = () => {
1285 + const ComponentWithEffects = () => {
1286 React.useLayoutEffect(() => {
1287 Scheduler.unstable_advanceTime(10);
1288 return () => {
@@ -1321,7 +1321,7 @@ describe('Profiler', () => {
1321
1322 const renderer = ReactTestRenderer.create(
1323 <React.Profiler id="mount-test" onCommit={callback}>
1324 - <ComponetWithEffects />
1324 + <ComponentWithEffects />
1325 <ComponentWithCommitHooks />
1326 </React.Profiler>,
1327 );
@@ -1341,7 +1341,7 @@ describe('Profiler', () => {
1341
1342 renderer.update(
1343 <React.Profiler id="update-test" onCommit={callback}>
1344 - <ComponetWithEffects />
1344 + <ComponentWithEffects />
1345 <ComponentWithCommitHooks />
1346 </React.Profiler>,
1347 );
@@ -1378,7 +1378,7 @@ describe('Profiler', () => {
1378 it('should report time spent in layout effects and commit lifecycles with cascading renders', () => {
1379 const callback = jest.fn();
1380
1381 - const ComponetWithEffects = ({shouldCascade}) => {
1381 + const ComponentWithEffects = ({shouldCascade}) => {
1382 const [didCascade, setDidCascade] = React.useState(false);
1383 React.useLayoutEffect(() => {
1384 if (shouldCascade && !didCascade) {
@@ -1414,7 +1414,7 @@ describe('Profiler', () => {
1414
1415 const renderer = ReactTestRenderer.create(
1416 <React.Profiler id="mount-test" onCommit={callback}>
1417 - <ComponetWithEffects shouldCascade={true} />
1417 + <ComponentWithEffects shouldCascade={true} />
1418 <ComponentWithCommitHooks />
1419 </React.Profiler>,
1420 );
@@ -1443,7 +1443,7 @@ describe('Profiler', () => {
1443
1444 renderer.update(
1445 <React.Profiler id="update-test" onCommit={callback}>
1446 - <ComponetWithEffects />
1446 + <ComponentWithEffects />
1447 <ComponentWithCommitHooks shouldCascade={true} />
1448 </React.Profiler>,
1449 );
@@ -1472,7 +1472,7 @@ describe('Profiler', () => {
1472 it('should bubble time spent in layout effects to higher profilers', () => {
1473 const callback = jest.fn();
1474
1475 - const ComponetWithEffects = ({
1475 + const ComponentWithEffects = ({
1476 cleanupDuration,
1477 duration,
1478 setCountRef,
@@ -1498,14 +1498,14 @@ describe('Profiler', () => {
1498 renderer = ReactTestRenderer.create(
1499 <React.Profiler id="root-mount" onCommit={callback}>
1500 <React.Profiler id="a">
1501 - <ComponetWithEffects
1501 + <ComponentWithEffects
1502 duration={10}
1503 cleanupDuration={100}
1504 setCountRef={setCountRef}
1505 />
1506 </React.Profiler>
1507 <React.Profiler id="b">
1508 - <ComponetWithEffects duration={1000} cleanupDuration={10000} />
1508 + <ComponentWithEffects duration={1000} cleanupDuration={10000} />
1509 </React.Profiler>
1510 </React.Profiler>,
1511 );
@@ -1539,7 +1539,7 @@ describe('Profiler', () => {
1539 renderer.update(
1540 <React.Profiler id="root-update" onCommit={callback}>
1541 <React.Profiler id="b">
1542 - <ComponetWithEffects duration={1000} cleanupDuration={10000} />
1542 + <ComponentWithEffects duration={1000} cleanupDuration={10000} />
1543 </React.Profiler>
1544 </React.Profiler>,
1545 );
@@ -1572,7 +1572,7 @@ describe('Profiler', () => {
1572 }
1573 }
1574
1575 - const ComponetWithEffects = ({
1575 + const ComponentWithEffects = ({
1576 cleanupDuration,
1577 duration,
1578 effectDuration,
@@ -1600,20 +1600,20 @@ describe('Profiler', () => {
1600 <React.Profiler id="root" onCommit={callback}>
1601 <ErrorBoundary
1602 fallback={
1603 - <ComponetWithEffects
1603 + <ComponentWithEffects
1604 duration={10000000}
1605 effectDuration={100000000}
1606 cleanupDuration={1000000000}
1607 />
1608 }>
1609 - <ComponetWithEffects
1609 + <ComponentWithEffects
1610 duration={10}
1611 effectDuration={100}
1612 cleanupDuration={1000}
1613 shouldThrow={true}
1614 />
1615 </ErrorBoundary>
1616 - <ComponetWithEffects
1616 + <ComponentWithEffects
1617 duration={10000}
1618 effectDuration={100000}
1619 cleanupDuration={1000000}
@@ -1660,7 +1660,7 @@ describe('Profiler', () => {
1660 }
1661 }
1662
1663 - const ComponetWithEffects = ({
1663 + const ComponentWithEffects = ({
1664 cleanupDuration,
1665 duration,
1666 effectDuration,
@@ -1688,20 +1688,20 @@ describe('Profiler', () => {
1688 <React.Profiler id="root" onCommit={callback}>
1689 <ErrorBoundary
1690 fallback={
1691 - <ComponetWithEffects
1691 + <ComponentWithEffects
1692 duration={10000000}
1693 effectDuration={100000000}
1694 cleanupDuration={1000000000}
1695 />
1696 }>
1697 - <ComponetWithEffects
1697 + <ComponentWithEffects
1698 duration={10}
1699 effectDuration={100}
1700 cleanupDuration={1000}
1701 shouldThrow={true}
1702 />
1703 </ErrorBoundary>
1704 - <ComponetWithEffects
1704 + <ComponentWithEffects
1705 duration={10000}
1706 effectDuration={100000}
1707 cleanupDuration={1000000}
@@ -1731,20 +1731,20 @@ describe('Profiler', () => {
1731 <React.Profiler id="root" onCommit={callback}>
1732 <ErrorBoundary
1733 fallback={
1734 - <ComponetWithEffects
1734 + <ComponentWithEffects
1735 duration={10000000}
1736 effectDuration={100000000}
1737 cleanupDuration={1000000000}
1738 />
1739 }>
1740 - <ComponetWithEffects
1740 + <ComponentWithEffects
1741 duration={10}
1742 effectDuration={100}
1743 cleanupDuration={1000}
1744 shouldThrow={false}
1745 />
1746 </ErrorBoundary>
1747 - <ComponetWithEffects
1747 + <ComponentWithEffects
1748 duration={10000}
1749 effectDuration={100000}
1750 cleanupDuration={1000000}
@@ -1780,7 +1780,7 @@ describe('Profiler', () => {
1780 it('should report interactions that were active', () => {
1781 const callback = jest.fn();
1782
1783 - const ComponetWithEffects = () => {
1783 + const ComponentWithEffects = () => {
1784 const [didMount, setDidMount] = React.useState(false);
1785 React.useLayoutEffect(() => {
1786 Scheduler.unstable_advanceTime(didMount ? 1000 : 100);
@@ -1809,7 +1809,7 @@ describe('Profiler', () => {
1809 () => {
1810 ReactTestRenderer.create(
1811 <React.Profiler id="root" onCommit={callback}>
1812 - <ComponetWithEffects />
1812 + <ComponentWithEffects />
1813 </React.Profiler>,
1814 );
1815 },
@@ -1848,7 +1848,7 @@ describe('Profiler', () => {
1848 it('should report time spent in passive effects', () => {
1849 const callback = jest.fn();
1850
1851 - const ComponetWithEffects = () => {
1851 + const ComponentWithEffects = () => {
1852 React.useLayoutEffect(() => {
1853 // This layout effect is here to verify that its time isn't reported.
1854 Scheduler.unstable_advanceTime(5);
@@ -1877,7 +1877,7 @@ describe('Profiler', () => {
1877 ReactTestRenderer.act(() => {
1878 renderer = ReactTestRenderer.create(
1879 <React.Profiler id="mount-test" onPostCommit={callback}>
1880 - <ComponetWithEffects />
1880 + <ComponentWithEffects />
1881 </React.Profiler>,
1882 );
1883 });
@@ -1899,7 +1899,7 @@ describe('Profiler', () => {
1899 ReactTestRenderer.act(() => {
1900 renderer.update(
1901 <React.Profiler id="update-test" onPostCommit={callback}>
1902 - <ComponetWithEffects />
1902 + <ComponentWithEffects />
1903 </React.Profiler>,
1904 );
1905 });
@@ -1944,7 +1944,7 @@ describe('Profiler', () => {
1944 it('should report time spent in passive effects with cascading renders', () => {
1945 const callback = jest.fn();
1946
1947 - const ComponetWithEffects = () => {
1947 + const ComponentWithEffects = () => {
1948 const [didMount, setDidMount] = React.useState(false);
1949 React.useEffect(() => {
1950 if (!didMount) {
@@ -1963,7 +1963,7 @@ describe('Profiler', () => {
1963 ReactTestRenderer.act(() => {
1964 ReactTestRenderer.create(
1965 <React.Profiler id="mount-test" onPostCommit={callback}>
1966 - <ComponetWithEffects />
1966 + <ComponentWithEffects />
1967 </React.Profiler>,
1968 );
1969 });
@@ -1992,7 +1992,7 @@ describe('Profiler', () => {
1992 it('should bubble time spent in effects to higher profilers', () => {
1993 const callback = jest.fn();
1994
1995 - const ComponetWithEffects = ({
1995 + const ComponentWithEffects = ({
1996 cleanupDuration,
1997 duration,
1998 setCountRef,
@@ -2018,14 +2018,14 @@ describe('Profiler', () => {
2018 renderer = ReactTestRenderer.create(
2019 <React.Profiler id="root-mount" onPostCommit={callback}>
2020 <React.Profiler id="a">
2021 - <ComponetWithEffects
2021 + <ComponentWithEffects
2022 duration={10}
2023 cleanupDuration={100}
2024 setCountRef={setCountRef}
2025 />
2026 </React.Profiler>
2027 <React.Profiler id="b">
2028 - <ComponetWithEffects duration={1000} cleanupDuration={10000} />
2028 + <ComponentWithEffects duration={1000} cleanupDuration={10000} />
2029 </React.Profiler>
2030 </React.Profiler>,
2031 );
@@ -2059,7 +2059,7 @@ describe('Profiler', () => {
2059 renderer.update(
2060 <React.Profiler id="root-update" onPostCommit={callback}>
2061 <React.Profiler id="b">
2062 - <ComponetWithEffects duration={1000} cleanupDuration={10000} />
2062 + <ComponentWithEffects duration={1000} cleanupDuration={10000} />
2063 </React.Profiler>
2064 </React.Profiler>,
2065 );
@@ -2092,7 +2092,7 @@ describe('Profiler', () => {
2092 }
2093 }
2094
2095 - const ComponetWithEffects = ({
2095 + const ComponentWithEffects = ({
2096 cleanupDuration,
2097 duration,
2098 effectDuration,
@@ -2120,20 +2120,20 @@ describe('Profiler', () => {
2120 <React.Profiler id="root" onPostCommit={callback}>
2121 <ErrorBoundary
2122 fallback={
2123 - <ComponetWithEffects
2123 + <ComponentWithEffects
2124 duration={10000000}
2125 effectDuration={100000000}
2126 cleanupDuration={1000000000}
2127 />
2128 }>
2129 - <ComponetWithEffects
2129 + <ComponentWithEffects
2130 duration={10}
2131 effectDuration={100}
2132 cleanupDuration={1000}
2133 shouldThrow={true}
2134 />
2135 </ErrorBoundary>
2136 - <ComponetWithEffects
2136 + <ComponentWithEffects
2137 duration={10000}
2138 effectDuration={100000}
2139 cleanupDuration={1000000}
@@ -2180,7 +2180,7 @@ describe('Profiler', () => {
2180 }
2181 }
2182
2183 - const ComponetWithEffects = ({
2183 + const ComponentWithEffects = ({
2184 cleanupDuration,
2185 duration,
2186 effectDuration,
@@ -2209,20 +2209,20 @@ describe('Profiler', () => {
2209 <React.Profiler id="root" onPostCommit={callback}>
2210 <ErrorBoundary
2211 fallback={
2212 - <ComponetWithEffects
2212 + <ComponentWithEffects
2213 duration={10000000}
2214 effectDuration={100000000}
2215 cleanupDuration={1000000000}
2216 />
2217 }>
2218 - <ComponetWithEffects
2218 + <ComponentWithEffects
2219 duration={10}
2220 effectDuration={100}
2221 cleanupDuration={1000}
2222 shouldThrow={true}
2223 />
2224 </ErrorBoundary>
2225 - <ComponetWithEffects
2225 + <ComponentWithEffects
2226 duration={10000}
2227 effectDuration={100000}
2228 cleanupDuration={1000000}
@@ -2252,20 +2252,20 @@ describe('Profiler', () => {
2252 <React.Profiler id="root" onPostCommit={callback}>
2253 <ErrorBoundary
2254 fallback={
2255 - <ComponetWithEffects
2255 + <ComponentWithEffects
2256 duration={10000000}
2257 effectDuration={100000000}
2258 cleanupDuration={1000000000}
2259 />
2260 }>
2261 - <ComponetWithEffects
2261 + <ComponentWithEffects
2262 duration={10}
2263 effectDuration={100}
2264 cleanupDuration={1000}
2265 shouldThrow={false}
2266 />
2267 </ErrorBoundary>
2268 - <ComponetWithEffects
2268 + <ComponentWithEffects
2269 duration={10000}
2270 effectDuration={100000}
2271 cleanupDuration={1000000}
@@ -2303,7 +2303,7 @@ describe('Profiler', () => {
2303 it('should report interactions that were active', () => {
2304 const callback = jest.fn();
2305
2306 - const ComponetWithEffects = () => {
2306 + const ComponentWithEffects = () => {
2307 const [didMount, setDidMount] = React.useState(false);
2308 React.useEffect(() => {
2309 Scheduler.unstable_advanceTime(didMount ? 1000 : 100);
@@ -2333,7 +2333,7 @@ describe('Profiler', () => {
2333 () => {
2334 ReactTestRenderer.create(
2335 <React.Profiler id="root" onPostCommit={callback}>
2336 - <ComponetWithEffects />
2336 + <ComponentWithEffects />
2337 </React.Profiler>,
2338 );
2339 },
@@ -2875,7 +2875,7 @@ describe('Profiler', () => {
2875 Scheduler.unstable_yieldValue('onPostCommit');
2876 });
2877
2878 - const ComponetWithEffects = () => {
2878 + const ComponentWithEffects = () => {
2879 React.useEffect(() => {
2880 Scheduler.unstable_yieldValue('passive effect');
2881 });
@@ -2892,7 +2892,7 @@ describe('Profiler', () => {
2892 id="root"
2893 onCommit={onCommit}
2894 onPostCommit={onPostCommit}>
2895 - <ComponetWithEffects />
2895 + <ComponentWithEffects />
2896 </React.Profiler>,
2897 );
2898 });
packages/scheduler/src/Scheduler.js
+1 -1
@@ -147,7 +147,7 @@ function flushWork(hasTimeRemaining, initialTime) {
147 throw error;
148 }
149 } else {
150 - // No catch in prod codepath.
150 + // No catch in prod code path.
151 return workLoop(hasTimeRemaining, initialTime);
152 }
153 } finally {
packages/scheduler/src/forks/SchedulerHostConfig.default.js
+1 -1
@@ -174,7 +174,7 @@ if (
174 // Using console['error'] to evade Babel and ESLint
175 console['error'](
176 'forceFrameRate takes a positive int between 0 and 125, ' +
177 - 'forcing framerates higher than 125 fps is not unsupported',
177 + 'forcing frame rates higher than 125 fps is not unsupported',
178 );
179 return;
180 }
packages/shared/ReactFeatureFlags.js
+1 -1
@@ -8,7 +8,7 @@
8 */
9
10 // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
11 -// This prevents e.g. <img src=""> from making an unnecessar HTTP request for certain browsers.
11 +// This prevents e.g. <img src=""> from making an unnecessary HTTP request for certain browsers.
12 export const enableFilterEmptyStringAttributesDOM = false;
13
14 // Adds verbose console logging for e.g. state updates, suspense, and work loop stuff.
scripts/error-codes/__tests__/invertObject-test.js
+1 -1
@@ -27,7 +27,7 @@ describe('invertObject', () => {
27 });
28 });
29
30 - it("should take the last value when there're duplications in vals", () => {
30 + it('should take the last value when there are duplications in vals', () => {
31 expect(
32 invertObject({
33 a: '3',
scripts/error-codes/codes.json
+4 -4
@@ -181,7 +181,7 @@
181 "178": "Should have next effect. This error is likely caused by a bug in React. Please file an issue.",
182 "179": "Should have a pending commit. This error is likely caused by a bug in React. Please file an issue.",
183 "180": "Commit phase errors should be scheduled to recover with task priority. This error is likely caused by a bug in React. Please file an issue.",
184 - "181": "Switch statement should be exhuastive. This error is likely caused by a bug in React. Please file an issue.",
184 + "181": "Switch statement should be exhaustive. This error is likely caused by a bug in React. Please file an issue.",
185 "182": "performWork was called recursively. This error is likely caused by a bug in React. Please file an issue.",
186 "183": "Should have found an error boundary. This error is likely caused by a bug in React. Please file an issue.",
187 "184": "No error for given unit of work. This error is likely caused by a bug in React. Please file an issue.",
@@ -255,7 +255,7 @@
255 "253": "work.commit(): Cannot commit while already rendering. This likely means you attempted to commit from inside a lifecycle method.",
256 "254": "Element ref was specified as a string (%s) but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a functional component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://fb.me/react-refs-must-have-owner for more information.",
257 "255": "Expected ReactFbErrorUtils.invokeGuardedCallback to be a function.",
258 - "256": "Expected ReactFiberErrorDialog.showErrorDialog to existbe a function.",
258 + "256": "Expected ReactFiberErrorDialog.showErrorDialog to be a function.",
259 "257": "Portals are not currently supported by the server renderer. Render them conditionally so that they only appear on the client render.",
260 "258": "Unknown element-like object type: %s. This is likely a bug in React. Please file an issue.",
261 "259": "The experimental Call and Return types are not currently supported by the server renderer.",
@@ -271,7 +271,7 @@
271 "269": "Profiler must specify an \"id\" string and \"onRender\" function as props",
272 "270": "The current renderer does not support persistence. This error is likely caused by a bug in React. Please file an issue.",
273 "271": "Failed to replay rendering after an error. This is likely caused by a bug in React. Please file an issue with a reproducing case to help us find it.",
274 - "272": "The current renderer does not support hyration. This error is likely caused by a bug in React. Please file an issue.",
274 + "272": "The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue.",
275 "273": "Nesting of <View> within <Text> is not currently supported.",
276 "274": "Text strings must be rendered within a <Text> component.",
277 "275": "The current renderer does not support mutation. This error is likely caused by a bug in React. Please file an issue.",
@@ -366,5 +366,5 @@
366 "365": "Invalid selector type %s specified.",
367 "366": "ReactDOM.createEventHandle: setListener called on an target that did not have a corresponding root. This is likely a bug in React.",
368 "367": "ReactDOM.createEventHandle: setListener called on an element target that is not managed by React. Ensure React rendered the DOM element.",
369 - "368": "ReactDOM.createEventHandle: setListener called on an invalid target. Provide a vaid EventTarget or an element managed by React."
369 + "368": "ReactDOM.createEventHandle: setListener called on an invalid target. Provide a valid EventTarget or an element managed by React."
370 }