2017-02-15 03:58:24 +00:00
|
|
|
/**
|
2017-10-04 17:06:57 +00:00
|
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
2017-02-15 03:58:24 +00:00
|
|
|
*
|
2017-10-04 17:06:57 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-02-15 03:58:24 +00:00
|
|
|
*
|
2018-05-15 20:08:47 +00:00
|
|
|
* @format
|
2018-08-09 15:32:04 +00:00
|
|
|
* @flow strict-local
|
2017-02-15 03:58:24 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2018-04-10 22:19:57 +00:00
|
|
|
import type {ViewConfigGetter} from './ReactNativeTypes';
|
2017-02-15 03:58:24 +00:00
|
|
|
|
2018-04-10 22:19:57 +00:00
|
|
|
const {register} = require('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: ViewConfigGetter,
|
|
|
|
): string {
|
|
|
|
return register(name, callback);
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = createReactNativeComponentClass;
|