/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-dom-bindings/src/client/ReactDOMContainer.js
29 строк
756 B
Josh Story
[Fiber] Disable comments as containers in OSS (#32250)
04 фев 2025, 23:39
Не верифицирован
04 фев 2025, 23:39
0605cd9
Код
Авторство
О чём код?
/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @flow */ import {disableCommentsAsDOMContainers} from 'shared/ReactFeatureFlags'; import { ELEMENT_NODE, COMMENT_NODE, DOCUMENT_NODE, DOCUMENT_FRAGMENT_NODE, } from './HTMLNodeType'; export function isValidContainer(node: any): boolean { return !!( node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || (!disableCommentsAsDOMContainers && node.nodeType === COMMENT_NODE && (node: any).nodeValue === ' react-mount-point-unstable ')) ); }