/
githubmr
/
facebook-react
Обзор
Документация
Войти
/
githubmr
/
facebook-react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
v17.0.2
packages/react/src/ReactFundamental.js
33 строки
939 B
Ricky
Fix spelling errors and typos (#19138)
16 июн 2020, 02:59
Не верифицирован
16 июн 2020, 02:59
30b4710
Код
Авторство
О чём код?
/** * Copyright (c) Facebook, Inc. and its 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 type { ReactFundamentalImpl, ReactFundamentalComponent, } from 'shared/ReactTypes'; import {REACT_FUNDAMENTAL_TYPE} from 'shared/ReactSymbols'; import {hasBadMapPolyfill} from './BadMapPolyfill'; export function createFundamental<C, H>( impl: ReactFundamentalImpl<C, H>, ): ReactFundamentalComponent<C, H> { // We use responder as a Map key later on. When we have a bad // polyfill, then we can't use it as a key as the polyfill tries // to add a property to the object. if (__DEV__ && !hasBadMapPolyfill) { Object.freeze(impl); } const fundamentalComponent = { $$typeof: REACT_FUNDAMENTAL_TYPE, impl, }; if (__DEV__) { Object.freeze(fundamentalComponent); } return fundamentalComponent; }