Skip to content

Commit

Permalink
nits
Browse files Browse the repository at this point in the history
  • Loading branch information
gnoff committed Feb 10, 2023
1 parent 46a44fd commit 9dc0695
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -220,7 +194,7 @@ type PropDifferences = {
},
},
};
export function compareResourcePropsForWarning(
function compareResourcePropsForWarning(
newProps: any,
currentProps: any,
): null | PropDifferences {
Expand Down
1 change: 0 additions & 1 deletion packages/react-dom/src/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
5 changes: 1 addition & 4 deletions packages/react-reconciler/src/ReactFiberBeginWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9dc0695

Please sign in to comment.