Skip to content

RNTester: example list search filter resets after returning from an example #59868

Open

Description

@douglowder

Description

In RNTester, the search text in the Components and APIs lists resets when you open an example and go back. You must enter the filter again each time.

The cause is in RNTester itself: RNTesterExampleFilter keeps filter and category in its own component state, and RNTesterAppShared renders RNTesterModuleList, which contains the filter, only when no example is open. Opening an example unmounts the filter and drops its state. A possible fix is to keep the filter state in RNTesterAppShared or in the navigation reducer, next to the recentlyUsed state that already lives there.

Steps to reproduce

  1. Open RNTester and go to the Components list.
  2. Type Flat in the "Search..." field and press Return. The list shows only FlatList.
  3. Open FlatList.
  4. Tap Back.

Expected: The list shows with the search text Flat, as before.

Actual: The search field is empty ("Search...") and the full list shows, with FlatList under "Recently Viewed".

TV builds (react-native-tvos) also show category pills above the list, and the selected category resets in the same way.

React Native Version

main at f480836 (packages/react-native version 1000.0.0)

Affected Platforms

Runtime - iOS

Tested on an iPhone 18 Pro simulator, iOS 27.0, RNTester debug build. Also seen on the Apple TV 4K (3rd generation) simulator, tvOS 27.0, with the react-native-tvos RNTester, which uses the same code. Not tested on Android.

Output of npx @react-native-community/cli info

System:
  OS: macOS 26.7.1
  CPU: (18) arm64 Apple M5 Pro
  Memory: 1.60 GB / 48.00 GB
  Shell:
    version: 5.3.20
    path: /opt/homebrew/bin/bash
Binaries:
  Node:
    version: 24.13.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 11.4.2
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2026.07.27.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.17.0
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 27.2
      - iOS 27.2
      - macOS 27.2
      - tvOS 27.2
      - visionOS 27.2
      - watchOS 27.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2025.1 AI-251.26094.121.2512.13840223
  Xcode:
    version: 27.2/27B52
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.20.1
    path: /usr/bin/javac
  Ruby:
    version: 4.0.7
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

None. No error or warning is logged; the filter state is lost when the list unmounts.

MANDATORY Reproducer

The reproducer is RNTester in this repository (packages/rn-tester), with the steps above.

Screenshots and Videos

No response

Activity

  1. react-native-bot commented on Nov 9, 2026

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:


    You can read more about about it on our website: How to report a bug.

  2. douglowder commented on Nov 9, 2026

    @douglowder
    ContributorAuthor

    The reproducer is RNTester in this repository, so there is no separate app or Snack to link. The bug is in RNTester's own code:

    • packages/rn-tester/js/components/RNTesterExampleFilter.js keeps filter and category in component state.
    • packages/rn-tester/js/RNTesterAppShared.js renders RNTesterModuleList, which contains that filter, only when no example is open.

    To reproduce, build and run RNTester from main, then follow the steps in the issue description.

  3. guilenzolari commented on Nov 11, 2026

    @guilenzolari

    Hi @douglowder!

    I'd like to work on this issue.

    I noticed that the bot flagged it as missing a reproducer, but since this is a bug in RNTester's own navigation and component state, the existing reproduction steps require running RNTester itself.

    Would the existing steps be sufficient for this case, or would you prefer a separate reproducer PR? I'm happy to provide one if needed.

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: AttentionIssues where the author has responded to feedback.Needs: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions