mirror of
https://github.com/facebook/react.git
synced 2026-02-23 12:13:04 +00:00
## Summary I'm working to get the main `react-native` package parsable by modern Flow tooling (both `flow-bundler`, `flow-api-translator`), and one blocker is legacy `module.exports` syntax. This diff updates files which are [synced to `react-native`](https://github.com/facebook/react-native/tree/main/packages/react-native/Libraries/Renderer/shims) from this repo. ## How did you test this change? Files were pasted into `react-native-github` under fbsource, where Flow validates ✅.
35 lines
945 B
JavaScript
35 lines
945 B
JavaScript
/**
|
|
* 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.
|
|
*
|
|
* @noformat
|
|
* @nolint
|
|
* @flow strict-local
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import {ReactNativeViewConfigRegistry} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
|
|
import {type ViewConfig} from './ReactNativeTypes';
|
|
|
|
const {register} = ReactNativeViewConfigRegistry;
|
|
|
|
/**
|
|
* Creates a renderable ReactNative host component.
|
|
* Use this method for view configs that are loaded from UIManager.
|
|
* Use createReactNativeComponentClass() for view configs defined within JavaScript.
|
|
*
|
|
* @param {string} config iOS View configuration.
|
|
* @private
|
|
*/
|
|
const createReactNativeComponentClass = function (
|
|
name: string,
|
|
callback: () => ViewConfig,
|
|
): string {
|
|
return register(name, callback);
|
|
};
|
|
|
|
export default createReactNativeComponentClass;
|