Skip to content

chore: add support for react-native@0.87.0-rc.1#4375

Draft
t0maboro wants to merge 11 commits into
mainfrom
@t0maboro/rn-087
Draft

chore: add support for react-native@0.87.0-rc.1#4375
t0maboro wants to merge 11 commits into
mainfrom
@t0maboro/rn-087

Conversation

@t0maboro

@t0maboro t0maboro commented Jul 21, 2026

Copy link
Copy Markdown
Member

Description

Based on the upgrade helper: https://react-native-community.github.io/upgrade-helper/?from=0.86.0&to=0.87.0-rc.1

Note: waiting for react/react-native#57628

description in progress.

Closes: https://github.com/software-mansion/react-native-screens-labs/issues/1666

Changes

  • in progress

Before & after - visual documentation

N/A

Test plan

in progress

Checklist

  • Included code example that can be used to test this change.
  • For visual changes, included screenshots / GIFs / recordings documenting the change.
  • For API changes, updated relevant public types.
  • Ensured that CI passes

Comment thread src/components/Screen.tsx
Comment on lines +233 to +240
style={[
style,
// The cast is needed because `exactOptionalPropertyTypes` forbids an explicit `undefined` on `zIndex`
// after enabling strict types in RN 0.87 where it is typed as `zIndex?: number`.
{ zIndex: undefined } as {
zIndex?: number | undefined;
} as ViewStyle,
]}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: workaround, because undefined was removed from public type for zIndex

Comment thread src/types.tsx
Comment on lines +24 to +27
export interface TextInputFocusEventData extends TargetedEvent {
eventCount: number;
text: string;
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for further discussion: I haven't found an equivalent in strict types on 0.87, I decided to copy the type from the core to avoid breaking changes in public API

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates react-native-screens to build and type-check against react-native@0.87.0-rc.1, including related dependency/tooling bumps and several type-level adjustments required by upstream React Native and Android Gradle Plugin changes.

Changes:

  • Update JS/TS types and component implementations to align with RN 0.87 type exports and stricter TS settings (e.g., ViewInstance, removed RN exports, exactOptionalPropertyTypes).
  • Adjust Android Gradle integration for AGP 9 built-in Kotlin behavior and update example Android tooling (Gradle, SDK, Kotlin).
  • Initialize default Fabric _props in several iOS component views to match RN 0.87 expectations.

Reviewed changes

Copilot reviewed 28 out of 33 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tsconfig.json Switch TS module resolution to bundler and adjust path mappings for the library.
src/types.tsx Update public types for RN 0.87 (e.g., ViewInstance) and add local TextInputFocusEventData compatibility type.
src/private/hooks/useRenderDebugInfo.tsx Replace removed/renamed RN types (ReactNativeElementHostInstance).
src/gesture-handler/fabricUtils.ts Update ref/instance typing to RN 0.87’s ViewInstance.
src/fabric/SearchBarNativeComponent.ts Update native commands typing to newer React ref helper types.
src/components/tabs/host/TabsHost.android.tsx Avoid passing { direction: undefined } in styles under stricter typing.
src/components/SearchBar.tsx Refactor SearchBar ref/commands wiring to match RN 0.87 typing changes.
src/components/ScreenStackItem.tsx Update forwarded ref typing and tighten optional style handling.
src/components/ScreenStackHeaderConfig.tsx Adjust non-iOS alignItems to explicit Yoga default (stretch).
src/components/Screen.web.tsx Attempt to pass ref through to inner web <View/>.
src/components/Screen.tsx Update ref typing and add cast workaround for zIndex: undefined under exactOptionalPropertyTypes.
src/components/gamma/stack/host/StackHost.types.ts Update host ref type from ReactNativeElement to HostInstance.
src/components/gamma/stack/host/StackHost.tsx Normalize ref passed to native component (undefinednull).
src/components/gamma/stack/header/ios/StackHeaderItem.ios.tsx Guard Image.resolveAssetSource returning falsy.
package.json Bump RN toolchain/dev deps to 0.87.0-rc.1 and TypeScript to ^6.0.3.
ios/tabs/bottom-accessory/RNSTabsBottomAccessoryContentComponentView.mm Set default Fabric _props in initializer.
ios/tabs/bottom-accessory/RNSTabsBottomAccessoryComponentView.mm Set default Fabric _props in initializer.
ios/RNSScreenFooter.mm Set default Fabric _props in initializer.
ios/RNSScreenContentWrapper.mm Add initWithFrame to set default Fabric _props.
ios/gamma/stack/host/RNSStackHostComponentView.mm Set default Fabric _props in initializer.
ios/gamma/modals/form-sheet/RNSFormSheetContentWrapperComponentView.mm Add initWithFrame to set default Fabric _props.
FabricExample/yarn.lock Update example lockfile for RN 0.87 toolchain and dependency graph changes.
FabricExample/tsconfig.json Update example TS types list.
FabricExample/package.json Bump example app RN + toolchain deps to 0.87.0-rc.1 and TS ^6.0.3.
FabricExample/ios/Podfile.lock Update CocoaPods lockfile for RN 0.87.0-rc.1 pods/layout.
FabricExample/android/gradlew Update gradlew template link reference.
FabricExample/android/gradle/wrapper/gradle-wrapper.properties Bump Gradle distribution to 9.4.1.
FabricExample/android/gradle.properties Add AGP 9 opt-outs for built-in Kotlin and new DSL.
FabricExample/android/build.gradle Bump compile/build tools and Kotlin versions.
FabricExample/android/app/build.gradle Switch to proguard-android-optimize.txt.
android/build.gradle Conditionally apply Kotlin plugin based on AGP 9 built-in Kotlin; add kotlin source dir configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to 28
function SearchBar(props: SearchBarProps) {
const searchBarRef = React.useRef<SearchBarHostInstance | null>(null);

function SearchBar(
props: SearchBarProps,
forwardedRef: React.Ref<SearchBarCommands>,
) {
const searchBarRef = React.useRef<SearchBarCommands>(null);

React.useImperativeHandle(forwardedRef, () => ({
React.useImperativeHandle(props.ref, () => ({
blur: () => {
}

export default React.forwardRef<SearchBarCommands, SearchBarProps>(SearchBar);
export default SearchBar;
Comment on lines 16 to +26
let {
active,
activityState,
style,
enabled = screensEnabled(),
ref,
...rest
} = this.props;

const refProp = ref !== undefined ? { ref } : {};

Comment on lines 4 to 6
"baseUrl": ".",
"types": ["jest", "node"],
"types": ["node"],
"paths": {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants