Remove deprecated Instance type aliases (Flow) (#57229)

Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57229

Remove the deprecated `PublicScrollViewInstance` and `PublicModalInstance` type aliases, replacing all remaining usages with the canonical `ScrollViewInstance` and `ModalInstance` types.

NOTE: Existing equivalent types are **left alone** in the manual `.d.ts` sources (current TS API), as this is covered by the existing breaking migration notes for ref types under the Strict API.

**Changes**

- Delete `PublicScrollViewInstance` alias (ScrollView.js)
- Delete `PublicModalInstance` alias (Modal.js)
- Update `IntersectionObserverExplicitRootScroll.js` rn-tester example

Changelog:
[General][Removed] - **Strict TypeScript API**: Remove deprecated `PublicScrollViewInstance` and `PublicModalInstance` types. Use `ScrollViewInstance` and `ModalInstance` instead.

Reviewed By: cipolleschi

Differential Revision: D107268481

fbshipit-source-id: fbcd42378bf13919d5b14d5472f3c5ff4ffbbc9d
This commit is contained in:
Alex Hunt authored and meta-codesync[bot] committed 2026-06-16 07:01:30 -07:00
1 parent 25f68107fa
commit 74fdfd1eab
3 files changed
+3 -10

No files matched your search

@@ -171,9 +171,6 @@ export interface ScrollViewInstance
extends HostInstance,
ScrollViewImperativeMethods {}
/** @deprecated Use ScrollViewInstance instead */
export type PublicScrollViewInstance = ScrollViewInstance;
type InnerViewInstance = React.ElementRef<typeof View>;
export type ScrollViewPropsIOS = Readonly<{
-3
View File
@@ -38,9 +38,6 @@ type ModalEventDefinitions = {
export type ModalInstance = HostInstance;
/** @deprecated Use ModalInstance instead */
export type PublicModalInstance = ModalInstance;
const ModalEventEmitter =
Platform.OS === 'ios' && NativeModalManager != null
? new NativeEventEmitter<ModalEventDefinitions>(
@@ -8,8 +8,7 @@
* @flow strict-local
*/
import type {HostInstance} from 'react-native';
import type {PublicScrollViewInstance} from 'react-native/Libraries/Components/ScrollView/ScrollView';
import type {HostInstance, ScrollViewInstance} from 'react-native';
import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
import type IntersectionObserverType from 'react-native/src/private/webapis/intersectionobserver/IntersectionObserver';
@@ -42,8 +41,8 @@ component IntersectionObserverExplicitRootScrollExample() {
const [observationRoot, setObservationRoot] = useState<?HostInstance>(null);
const [showMargin, setShowMargin] = useState(true);
const roofRef: React.RefSetter<PublicScrollViewInstance> = useCallback(
(rootNode: ?PublicScrollViewInstance) => {
const roofRef: React.RefSetter<ScrollViewInstance> = useCallback(
(rootNode: ?ScrollViewInstance) => {
if (rootNode != null) {
setObservationRoot(rootNode);
}