Skip to content

Commit 6429c1e

Browse files
kidrocaBeamanatormarcaarontgolen
authored
Apply suggested typo fixes and clarifications
Co-authored-by: Alex Beaman <[email protected]> Co-authored-by: Marc Glasser <[email protected]> Co-authored-by: Tim Golen <[email protected]>
1 parent e2248d6 commit 6429c1e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/react-native-web/src/exports/Image/__tests__/index-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ describe('components/Image', () => {
257257
expect(onLoadEndStub.mock.calls.length).toBe(1);
258258
});
259259

260-
// This test verifies that wen source is declared in-line and the parent component
260+
// This test verifies that when source is declared in-line and the parent component
261261
// re-renders we aren't restarting the load process because the source is structurally equal
262262
test('is not called on update when "headers" and "uri" are not modified', () => {
263263
const onLoadStartStub = jest.fn();
@@ -451,7 +451,7 @@ describe('components/Image', () => {
451451
);
452452
});
453453

454-
// A common case is `source` declared as an inline object, which cause is to be a
454+
// A common case is `source` declared as an inline object, which creates a
455455
// new object (with the same content) each time parent component renders
456456
test('it still loads the image if source object is changed', () => {
457457
ImageLoader.load.mockImplementation(() => {});

packages/react-native-web/src/exports/Image/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ const useSource = (
382382
}, [source]);
383383

384384
// Always use the latest value of any callback passed
385-
// Keeping a ref we avoid (re)triggering the load effect just because a callback changed
385+
// By keeping a ref, we avoid (re)triggering the load effect just because a callback changed
386386
// (E.g. we don't want to trigger a new load because the `onLoad` prop changed)
387387
const callbackRefs = React.useRef(callbacks);
388388
callbackRefs.current = callbacks;
@@ -425,7 +425,7 @@ const useSource = (
425425
setStatus(LOADING);
426426
const requestId = ImageLoader.load(resolvedSource, handleLoad, handleError);
427427

428-
// Release resources on umount or after starting a new request
428+
// Release resources on unmount or after starting a new request
429429
return () => ImageLoader.release(requestId);
430430
}, [resolvedSource]);
431431

0 commit comments

Comments
 (0)