mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
* Move view config registry to shims This ensures that both Fabric and RN renderers share the same view config registry since it is stateful. I had to duplicate in the mocks for testing. * Move createReactNativeComponentClass to shims and delete internal usage Since createReactNativeComponentClass is just an alias for the register there's no need to bundle it. This file should probably just move back to RN too.
33 lines
856 B
JavaScript
33 lines
856 B
JavaScript
/**
|
|
* Copyright (c) 2013-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @providesModule createReactNativeComponentClass
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {ViewConfigGetter} from './ReactNativeTypes';
|
|
|
|
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);
|
|
};
|
|
|
|
export default createReactNativeComponentClass;
|