From 9dc0695de6f5e7bf544cc95aaf2189a1675763e2 Mon Sep 17 00:00:00 2001 From: Josh Story Date: Thu, 9 Feb 2023 22:14:58 -0800 Subject: [PATCH] nits --- .../src/client/ReactDOMFloatClient.js | 2 +- .../src/shared/ReactDOMResourceValidation.js | 28 +------------------ .../src/__tests__/ReactDOMComponent-test.js | 1 - .../src/ReactFiberBeginWork.js | 5 +--- 4 files changed, 3 insertions(+), 33 deletions(-) diff --git a/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js b/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js index 10c44364c5b60..33d2800ec37e4 100644 --- a/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js +++ b/packages/react-dom-bindings/src/client/ReactDOMFloatClient.js @@ -843,7 +843,7 @@ export function hydrateHoistable( internalInstanceHandle: Object, ): Instance { const ownerDocument = getDocumentFromRoot(hoistableRoot); - const nodes = ownerDocument.querySelectorAll(type); + const nodes = ownerDocument.getElementsByTagName(type); const children = props.children; let child, childString; diff --git a/packages/react-dom-bindings/src/shared/ReactDOMResourceValidation.js b/packages/react-dom-bindings/src/shared/ReactDOMResourceValidation.js index 0a61d0f1e5688..71f48665bb4cc 100644 --- a/packages/react-dom-bindings/src/shared/ReactDOMResourceValidation.js +++ b/packages/react-dom-bindings/src/shared/ReactDOMResourceValidation.js @@ -7,32 +7,6 @@ * @flow */ -import hasOwnProperty from 'shared/hasOwnProperty'; - -function getResourceNameForWarning( - type: string, - props: Object, - implicit: boolean, -) { - if (__DEV__) { - switch (type) { - case 'style': { - return 'style Resource'; - } - case 'script': { - return 'script Resource'; - } - case 'preload': { - if (implicit) { - return `preload for a ${props.as} Resource`; - } - return `preload Resource (as "${props.as}")`; - } - } - } - return 'Resource'; -} - export function validateLinkPropsForStyleResource(props: any): boolean { if (__DEV__) { // This should only be called when we know we are opting into Resource semantics (i.e. precedence is not null) @@ -220,7 +194,7 @@ type PropDifferences = { }, }, }; -export function compareResourcePropsForWarning( +function compareResourcePropsForWarning( newProps: any, currentProps: any, ): null | PropDifferences { diff --git a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js index 946c5b2f3367b..b474103f97ad3 100644 --- a/packages/react-dom/src/__tests__/ReactDOMComponent-test.js +++ b/packages/react-dom/src/__tests__/ReactDOMComponent-test.js @@ -494,7 +494,6 @@ describe('ReactDOMComponent', () => { 'To fix this, either do not render the element at all ' + 'or pass null to href instead of an empty string.', ); - console.log('container', container.outerHTML); const node = container.firstChild; expect(node.hasAttribute('href')).toBe(false); diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js index 8317e8d10465d..f927646c187f7 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.js @@ -1643,10 +1643,7 @@ function updateHostHoistable( )); if (current === null) { if (!getIsHydrating() && resource === null) { - // This is not a Resource Hoistable and we aren't hydrating so we construct the - // We we aren't hydrating and can potentially prepare the hoistable instance now during - // render. Note that in some Hosts not all Hoistables will be able to produce an - // instance during render and they may be constructed during acquisition in the commit phase + // This is not a Resource Hoistable and we aren't hydrating so we construct the instance. workInProgress.stateNode = createHoistableInstance( workInProgress.type, workInProgress.pendingProps,