main
js 34 lines 918 Bytes
Raw
1 /**
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 * @noformat
8 * @nolint
9 * @flow strict-local
10 */
11
12 'use strict';
13
14 import {ReactNativeViewConfigRegistry} from 'react-native/react-private-interface';
15 import {type ViewConfig} from './ReactNativeTypes';
16
17 const {register} = ReactNativeViewConfigRegistry;
18
19 /**
20 * Creates a renderable ReactNative host component.
21 * Use this method for view configs that are loaded from UIManager.
22 * Use createReactNativeComponentClass() for view configs defined within JavaScript.
23 *
24 * @param {string} config iOS View configuration.
25 * @private
26 */
27 const createReactNativeComponentClass = function (
28 name: string,
29 callback: () => ViewConfig,
30 ): string {
31 return register(name, callback);
32 };
33
34 export default createReactNativeComponentClass;