Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@react-native/metro-babel-transformer": "0.77.0-main",
"@react-native/metro-config": "0.77.0-main",
"@tsconfig/node18": "1.0.1",
"@types/react": "^18.2.6",
"@types/react": "^19.0.0",
"@typescript-eslint/parser": "^7.1.1",
"ansi-styles": "^4.2.1",
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
Expand Down
1 change: 0 additions & 1 deletion packages/eslint-config-react-native/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ module.exports = {
'react/no-string-refs': 2,
'react/no-unknown-property': 0,
'react/no-unstable-nested-components': 1,
'react/prop-types': 0,
'react/react-in-jsx-scope': 1,
'react/self-closing-comp': 1,
'react/wrap-multilines': 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-popup-menu-android/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@react-native/codegen": "0.77.0-main"
},
"peerDependencies": {
"@types/react": "^18.2.6",
"@types/react": "^19.0.0",
"react": "*",
"react-native": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export interface DrawerLayoutAndroidProps extends ViewProps {
* The navigation view that will be rendered to the side of the
* screen and can be pulled in.
*/
renderNavigationView: () => JSX.Element;
renderNavigationView: () => React.JSX.Element;

/**
* Make the drawer take the entire screen and draw the background of
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/Libraries/Lists/FlatList.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export abstract class FlatListComponent<
/**
* Provides a handle to the underlying scroll responder.
*/
getScrollResponder: () => JSX.Element | null | undefined;
getScrollResponder: () => React.JSX.Element | null | undefined;

/**
* Provides a reference to the underlying host component
Expand Down
23 changes: 12 additions & 11 deletions packages/react-native/types/__typetests__/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ The content of index.io.js could be something like
For a list of complete Typescript examples: check https://github.com/bgrieder/RNTSExplorer
*/

import * as PropTypes from 'prop-types';
import * as React from 'react';
import {
AccessibilityInfo,
Expand Down Expand Up @@ -625,7 +624,7 @@ export class TouchableNativeFeedbackTest extends React.Component {

// PressableTest
export class PressableTest extends React.Component<{}> {
private readonly myRef: React.RefObject<View> = React.createRef();
private readonly myRef: React.RefObject<View | null> = React.createRef();

onPressButton = (e: GestureResponderEvent) => {
e.persist();
Expand Down Expand Up @@ -806,7 +805,9 @@ export class FlatListTest extends React.Component<FlatListProps<number>, {}> {
render() {
return (
<FlatList
ref={list => (this.list = list)}
ref={list => {
this.list = list;
}}
data={[1, 2, 3, 4, 5]}
renderItem={this._renderItem}
ItemSeparatorComponent={this._renderSeparator}
Expand Down Expand Up @@ -846,7 +847,7 @@ export class SectionListTest extends React.Component<
SectionListProps<string>,
{}
> {
myList: React.RefObject<SectionList<string>>;
myList: React.RefObject<SectionList<string> | null>;

constructor(props: SectionListProps<string>) {
super(props);
Expand Down Expand Up @@ -920,7 +921,7 @@ export class SectionListTypedSectionTest extends React.Component<
SectionListProps<string, SectionT>,
{}
> {
myList: React.RefObject<SectionList<string, SectionT>>;
myList: React.RefObject<SectionList<string, SectionT> | null>;

constructor(props: SectionListProps<string, SectionT>) {
super(props);
Expand Down Expand Up @@ -1248,7 +1249,9 @@ class TextInputTest extends React.Component<{}, {username: string}> {
</Text>

<TextInput
ref={input => (this.username = input)}
ref={input => {
this.username = input;
}}
textContentType="username"
autoComplete="username"
value={this.state.username}
Expand Down Expand Up @@ -1535,10 +1538,6 @@ const NativeBridgedComponent = requireNativeComponent<{nativeProp: string}>(
);

class BridgedComponentTest extends React.Component {
static propTypes = {
jsProp: PropTypes.string.isRequired,
};

nativeComponentRef: React.ElementRef<typeof NativeBridgedComponent> | null;

callNativeMethod = () => {
Expand All @@ -1563,7 +1562,9 @@ class BridgedComponentTest extends React.Component {
<NativeBridgedComponent
{...this.props}
nativeProp="test"
ref={ref => (this.nativeComponentRef = ref)}
ref={ref => {
this.nativeComponentRef = ref;
}}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/virtualized-lists/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"react-test-renderer": "19.0.0"
},
"peerDependencies": {
"@types/react": "^18.2.6",
"@types/react": "^19.0.0",
"react": "*",
"react-native": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"devDependencies": {
"@monorepo/pkg-a": "0.0.1",
"@monorepo/pkg-c": "0.0.0",
"@types/react": "^18.2.6",
"@types/react-test-renderer": "^18.0.0"
"@types/react": "^19.0.0",
"@types/react-test-renderer": "^19.0.0"
}
}
14 changes: 4 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2093,17 +2093,11 @@
resolved "https://registry.yarnpkg.com/@types/parsimmon/-/parsimmon-1.10.9.tgz#14e60db223c1d213fea0e15985d480b5cfe1789a"
integrity sha512-O2M2x1w+m7gWLen8i5DOy6tWRnbRcsW6Pke3j3HAsJUrPb4g0MgjksIUm2aqUtCYxy7Qjr3CzjjwQBzhiGn46A==

"@types/prop-types@*":
version "15.7.12"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6"
integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==

"@types/react@^18.2.6":
version "18.3.5"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.5.tgz#5f524c2ad2089c0ff372bbdabc77ca2c4dbadf8f"
integrity sha512-WeqMfGJLGuLCqHGYRGHxnKrXcTitc6L/nBUWfWPcTarG3t9PsquqUMuVeXZeca+mglY4Vo5GZjCi0A3Or2lnxA==
"@types/react@^19.0.0":
version "19.0.1"
resolved "https://registry.yarnpkg.com/@types/react/-/react-19.0.1.tgz#a000d5b78f473732a08cecbead0f3751e550b3df"
integrity sha512-YW6614BDhqbpR5KtUYzTA+zlA7nayzJRA9ljz9CQoxthR0sDisYZLuvSMsil36t4EH/uAt8T52Xb4sVw17G+SQ==
dependencies:
"@types/prop-types" "*"
csstype "^3.0.2"

"@types/responselike@^1.0.0":
Expand Down
Loading