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

Allow blank area to support multiple lists on the screen #57

Closed
ElviraBurchik opened this issue Jan 25, 2022 · 2 comments · Fixed by #108
Closed

Allow blank area to support multiple lists on the screen #57

ElviraBurchik opened this issue Jan 25, 2022 · 2 comments · Fixed by #108
Milestone

Comments

@ElviraBurchik
Copy link
Contributor

What

Per discussion.

More context:

The RecyclerFlatList allows enabling reporting blank areas on scroll via enableInstrumentation prop. When enabled, useOnNativeBlankAreaEvents hook reports the number of blank points when the list is scrolled.

However, it's possible to use multiple instances of RecyclerFlatList on the screen. In this case, the hook reports events from all instances through the same callback. There is no way to distinguish the metrics of different lists from each other.

One way to allow separate profiling of multiple lists is to make enableInstrumentation prop include listName. This allows discerning between lists based on the name.

@naqvitalha
Copy link
Collaborator

We should use instance level events and create a global emitter on JS. It's much cleaner than using listName which would be a string.
Check this doc: https://reactnative.dev/docs/native-components-ios#events

Instance level events are the standard and preferred way to doing this. Unless there is a benefit to global emitter we should avoid it.

@fortmarek
Copy link
Contributor

If we move to instance events, we will be able to get track the height of the component in the JS layer and we will no longer have to send it via bridge as mentioned here

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 a pull request may close this issue.

3 participants