mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
## Overview Reverts https://github.com/facebook/react/pull/26616 and implements the suggested way instead. This change in #26616 broken the internal sync command, which now results in duplicated `@generated` headers. It also makes it harder to detect changes during the diff train sync. Instead, we will check for changes, and if there are changes sign the files and commit them to the sync branch. ## Strategy The new sync strategy accounts for the generated headers during the sync: - **Revert Version**: Revert the version strings - **Revert @generated**: Re-sign the files (will be the same hash as before if unchanged) - **Check**: Check if there are changes **if not, skip** - **Re-apply Version**: Now add back the new version string - **Re-sign @generated**: And re-generate the headers Then commit to branch. This ensures that if there are no changes, we'll skip. --------- Co-authored-by: Timothy Yung <yungsters@gmail.com>
35 lines
947 B
JavaScript
35 lines
947 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);
|
|
};
|
|
|
|
module.exports = createReactNativeComponentClass;
|