22 lines
1.1 KiB
TypeScript
22 lines
1.1 KiB
TypeScript
/// <reference types="react" />
|
|
export declare const DOMAttributeNames: Record<string, string>;
|
|
/**
|
|
* When a `nonce` is present on an element, browsers such as Chrome and Firefox strip it out of the
|
|
* actual HTML attributes for security reasons *when the element is added to the document*. Thus,
|
|
* given two equivalent elements that have nonces, `Element,isEqualNode()` will return false if one
|
|
* of those elements gets added to the document. Although the `element.nonce` property will be the
|
|
* same for both elements, the one that was added to the document will return an empty string for
|
|
* its nonce HTML attribute value.
|
|
*
|
|
* This custom `isEqualNode()` function therefore removes the nonce value from the `newTag` before
|
|
* comparing it to `oldTag`, restoring it afterwards.
|
|
*
|
|
* For more information, see:
|
|
* https://bugs.chromium.org/p/chromium/issues/detail?id=1211471#c12
|
|
*/
|
|
export declare function isEqualNode(oldTag: Element, newTag: Element): boolean;
|
|
export default function initHeadManager(): {
|
|
mountedInstances: Set<unknown>;
|
|
updateHead: (head: JSX.Element[]) => void;
|
|
};
|