Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Float hoistables #13

Open
wants to merge 7 commits into
base: fizz-into-document
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/react-dom-bindings/src/client/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
updateWrapper as ReactDOMTextareaUpdateWrapper,
restoreControlledState as ReactDOMTextareaRestoreControlledState,
} from './ReactDOMTextarea';
import {getProps as ReactDOMTitleGetProps} from './ReactDOMTitle';
import {track} from './inputValueTracking';
import setInnerHTML from './setInnerHTML';
import setTextContent from './setTextContent';
Expand Down Expand Up @@ -79,6 +80,7 @@ import {
mediaEventTypes,
listenToNonDelegatedEvent,
} from '../events/DOMPluginEventSystem';
import {isMarkedResource} from './ReactDOMComponentTree';

let didWarnInvalidHydration = false;
let didWarnScriptTags = false;
Expand Down Expand Up @@ -574,6 +576,9 @@ export function setInitialProperties(
// listeners still fire for the invalid event.
listenToNonDelegatedEvent('invalid', domElement);
break;
case 'title':
props = ReactDOMTitleGetProps(isMarkedResource(domElement), rawProps);
break;
default:
props = rawProps;
}
Expand Down Expand Up @@ -641,6 +646,11 @@ export function diffProperties(
nextProps = ReactDOMTextareaGetHostProps(domElement, nextRawProps);
updatePayload = [];
break;
case 'title':
const isResource = isMarkedResource(domElement);
lastProps = ReactDOMTitleGetProps(isResource, lastRawProps);
nextProps = ReactDOMTitleGetProps(isResource, nextRawProps);
break;
default:
lastProps = lastRawProps;
nextProps = nextRawProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ export function getResourcesFromRoot(root: FloatRoot): RootResources {
resources = (root: any)[internalRootNodeResourcesKey] = {
styles: new Map(),
scripts: new Map(),
head: new Map(),
lastStructuredMeta: new Map(),
};
}
return resources;
Expand Down
Loading