From b200c7cb2f714e162cfc1d45b59fca4a9253233a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Wed, 22 Jan 2025 03:28:28 -0800 Subject: [PATCH] Replace $FlowFixMeProps in UnimplementedView (#48810) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48810 Changelog: [General][Changed] - Improved Props type in UnimplementedView Reviewed By: cortinico Differential Revision: D68437542 fbshipit-source-id: 134b834d77f65a94a6488c21298d79b060ea8109 --- .../Components/UnimplementedViews/UnimplementedView.js | 10 +++++++++- .../__tests__/__snapshots__/public-api-test.js.snap | 7 ++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js b/packages/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js index 3c884ad3f6c..00effa4508e 100644 --- a/packages/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js +++ b/packages/react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js @@ -9,14 +9,22 @@ */ 'use strict'; +import type {ViewStyleProp} from '../../StyleSheet/StyleSheet'; + import StyleSheet from '../../StyleSheet/StyleSheet'; import * as React from 'react'; +type Props = $ReadOnly<{ + style?: ?ViewStyleProp, + children?: React.Node, + ... +}>; + /** * Common implementation for a simple stubbed view. Simply applies the view's styles to the inner * View component and renders its children. */ -class UnimplementedView extends React.Component<$FlowFixMeProps> { +class UnimplementedView extends React.Component { render(): React.Node { // Workaround require cycle from requireNativeComponent const View = require('../View/View'); diff --git a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap index 2d8ba21be09..b04873ebb91 100644 --- a/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap +++ b/packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap @@ -3897,7 +3897,12 @@ declare export default typeof UnimplementedNativeViewNativeComponent; `; exports[`public API should not change unintentionally Libraries/Components/UnimplementedViews/UnimplementedView.js 1`] = ` -"declare class UnimplementedView extends React.Component<$FlowFixMeProps> { +"type Props = $ReadOnly<{ + style?: ?ViewStyleProp, + children?: React.Node, + ... +}>; +declare class UnimplementedView extends React.Component { render(): React.Node; } declare module.exports: UnimplementedView;