Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

element.ref React 19 #1543

Open
2 tasks done
erie-e9 opened this issue Mar 1, 2025 · 8 comments
Open
2 tasks done

element.ref React 19 #1543

erie-e9 opened this issue Mar 1, 2025 · 8 comments
Labels
bug Something isn't working

Comments

@erie-e9
Copy link

erie-e9 commented Mar 1, 2025

Current behavior

Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.

Image

Expected behavior

Terminal throws this error using this package, it disappears when replace it for FlatList

To Reproduce

import React from "react";
import { View, Text } from "react-native";
import { FlashList } from "@shopify/flash-list";

const DATA = [
  {
    title: "First Item",
  },
  {
    title: "Second Item",
  },
];

const MyList = () => {
  return (
    <FlashList
      data={DATA}
      renderItem={({ item }) => <Text>{item.title}</Text>}
      estimatedItemSize={200}
    />
  );
};

Platform:

  • iOS
  • Android

Environment

hermes enabled, new arch

"react": "19.0.0",
"react-native": "0.78.0",
"@shopify/flash-list": "^1.7.3",

@erie-e9 erie-e9 added the bug Something isn't working label Mar 1, 2025
@edgecaststudio
Copy link

Same issue

@kilinc89
Copy link

kilinc89 commented Mar 4, 2025

same issue.
Shopify team should update how refs are handled in the component

  private recyclerRef = (ref: any) => {
    this.rlvRef = ref;
  };

  private stickyContentRef = (ref: any) => {
    this.stickyContentContainerRef = ref;
  };

@craiganderson-iotv
Copy link

The React Native (0.78.0) stacktrace seems to point towards this line.

I'm not sure whether the issue is truly within the Flashlist or Flipkart/recyclerlistview though.

@enesuur
Copy link

enesuur commented Mar 6, 2025

I am facing the same issues, please let me know if any updates, thanks!

@MGS-DEV
Copy link

MGS-DEV commented Mar 9, 2025

Same here!

@VadymVashchuk
Copy link

Same issue

@himanshund123
Copy link

same issue

@naqvitalha
Copy link
Collaborator

I'm looking into this. I'll update soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants