Skip to content

Make react-native-worklets optional for React Native 0.76.x compatibility#69

Open
Copilot wants to merge 5 commits intomainfrom
copilot/fix-react-native-compatibility
Open

Make react-native-worklets optional for React Native 0.76.x compatibility#69
Copilot wants to merge 5 commits intomainfrom
copilot/fix-react-native-compatibility

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

rn-swiper-list v3.0.0 requires react-native-worklets which only supports React Native 0.78+, preventing users on 0.76.x from accessing critical bug fixes.

Changes

Compatibility layer (src/utils/workletCompat.ts)

  • Tries react-native-worklets first, falls back to react-native-reanimated's runOnJS/runOnUI
  • Provides consistent scheduleOnRN and scheduleOnUI API across both implementations

Package configuration

  • react-native-worklets moved to optional peer dependency via peerDependenciesMeta
  • Removed from direct dependencies

Source updates

  • Swiper.tsx and SwiperCard/index.tsx import from compatibility layer instead of react-native-worklets directly

Documentation

  • README clarifies react-native-worklets only needed for RN 0.78+
  • COMPATIBILITY.md details version support matrix

Compatibility

React Native react-native-worklets Implementation
0.76.x - 0.77.x Not required Uses reanimated's runOnJS/runOnUI
0.78+ Optional Prefers worklets, falls back to reanimated

No breaking changes. Existing code continues to work unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>"react-native": "0.76.9" support for version 3.0.0</issue_title>
<issue_description>### Before submitting a new issue

  • I tested using the latest version of the library, as the bug might be already fixed.
  • I tested using a supported version of react native.
  • I checked for possible duplicate issues, with possible answers.

Bug summary

I'm trying to upgrade from rn-swiper-list v2.5.0 to v3.0.0 to fix a critical issue
where cards with only 1 item don't display properly. However, v3.0.0 introduces a
dependency on react-native-worklets which is incompatible with React Native 0.76.9.

Environment

  • React Native version: 0.76.9
  • rn-swiper-list version: Attempting to upgrade from 2.5.0 → 3.0.0
  • Platform: iOS/Android
  • react-native-worklets version: 0.6.1 (required by v3.0.0)

The Problem

  1. v2.5.0: Works fine but has a bug where single-item cards don't render correctly
  2. v3.0.0: Fixes the single-item issue but requires react-native-worklets
  3. Compatibility: react-native-worklets 0.6.1 only supports React Native 0.78+
    according to
    https://docs.swmansion.com/react-native-worklets/docs/guides/compatibility/

Error Message

[Worklets] React Native 0.76.9 version is not compatible with Worklets 0.6.1

Current Situation

  • Upgrading React Native from 0.76.9 to 0.78+ is not feasible for our production app
    due to potential breaking changes
  • We need the single-item rendering fix that's available in v3.0.0
  • Stuck between incompatible versions

Possible Solutions

  1. Backport the single-item fix to v2.5.x: Could the single-item rendering fix be
    backported to a v2.5.x patch release that doesn't require worklets?
  2. Make worklets optional: Could v3.0.0 work without worklets for basic
    functionality, with worklets being an optional dependency for advanced features?
  3. Support older RN versions: Is there a way to make v3.0.0 compatible with React
    Native 0.76.x?

Question

Is there any way to get the single-item rendering fix working on React Native 0.76.9
without requiring the full worklets dependency? This would help many developers who
can't easily upgrade their React Native version.

Additional Context

Many production apps are still on React Native 0.76.x and would benefit from the bug
fixes in v3.0.0 without needing to perform major React Native upgrades.

Library version

3.0.0

Environment info

Environment info

  React Native Environment Info:
    System:
      OS: macOS 15.5 (24F74)
      CPU: (arm64) Apple Silicon
      Memory: N/A
      Shell: zsh
    Binaries:
      Node: 24.2.0
      npm: 11.3.0
    Development Tools:
      Xcode: 16.4 (Build version 16F6)
      CocoaPods: 1.16.2
    Expo:
      Expo CLI: 0.22.26
      Expo SDK: 52.0.47
    React Native:
      Version: 0.76.9
    Dependencies:
      react: 18.3.1
      react-native: 0.76.9
      react-native-reanimated: 3.16.1
      react-native-gesture-handler: 2.20.2
      rn-swiper-list: 2.5.0 (attempting to upgrade to 3.0.0)

  Package versions from package.json:
  - expo: ~52.0.47
  - react-native: 0.76.9
  - react-native-reanimated: ~3.16.1
  - react-native-gesture-handler: ~2.20.2

  Target upgrade:
  - rn-swiper-list: 2.5.0 → 3.0.0
  - Issue: v3.0.0 requires react-native-worklets which needs React Native ≥0.78

Steps to reproduce

  1. upgrade library to 3.0.0 and test on specified rn version

Reproducible example repository

https://nogitrepo.com</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@Skipperlla Skipperlla marked this pull request as ready for review October 24, 2025 21:24
Copilot AI review requested due to automatic review settings October 24, 2025 21:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


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

Copilot AI and others added 4 commits October 24, 2025 21:31
Co-authored-by: Skipperlla <68515357+Skipperlla@users.noreply.github.com>
Co-authored-by: Skipperlla <68515357+Skipperlla@users.noreply.github.com>
Co-authored-by: Skipperlla <68515357+Skipperlla@users.noreply.github.com>
Co-authored-by: Skipperlla <68515357+Skipperlla@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compatibility issue with rn-swiper-list v3.0.0 Make react-native-worklets optional for React Native 0.76.x compatibility Oct 24, 2025
Copilot AI requested a review from Skipperlla October 24, 2025 21:40
@markotrifunovic135
Copy link

Hi @Skipperlla i saw you opened this pr, does it mean it is possible and will be done? Thanks i dont want to rush anything just asking

@Skipperlla
Copy link
Owner

Hi @Skipperlla i saw you opened this pr, does it mean it is possible and will be done? Thanks i dont want to rush anything just asking

Since this feature arrived, I usually have Copilot review it first, then I go over it myself, and yes, I will merge it within this week.

@markotrifunovic135
Copy link

@Skipperlla have you been able to merge this?

@Skipperlla
Copy link
Owner

@Skipperlla have you been able to merge this?

Not yet, I need a few days or weeks, I'm very busy.

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.

"react-native": "0.76.9" support for version 3.0.0

4 participants