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

Ambiguity on why the index property in ViewToken is marked optional #3637

Open
jobpaardekooper opened this issue Mar 22, 2023 · 4 comments
Open
Labels
Never gets stale Prevent issues/PRs from getting stale

Comments

@jobpaardekooper
Copy link

jobpaardekooper commented Mar 22, 2023

Description

On the ViewToken page in the docs it shows that the index property is optional. This is not explained in any further detail by the docs.

What is the problem?

It is unclear to me in what situation this property would be null. This object is used as a parameter for the onViewableItemsChanged callback in VirtualizedList so it is in turn also used in both FlatList and SectionList. This makes me think there wouldn't be a situation where index would be null.

How can we address it?

Update the description of the index property on ViewToken to clarify in what situation it could be null.

If anyone knows a resource like an issue in the react-native repo or a from post that discusses this or can explain it to me I can also make a PR to clarify the description on the property.

Why is it important?

It is currently ambiguous why the index property on ViewToken is marked as optional.

Who needs this?

Anyone using the onViewableItemsChanged prop and relies on the indexes of the callback.

@github-actions
Copy link

👋 Hey there, it looks like there has been no activity on this issue in the last 90 days. Has the issue been fixed, or does it still require the community attention? This issue will be closed in the next 7 days if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues/PR that are not getting much activity and are closer to be closed label Jun 21, 2023
@jobpaardekooper
Copy link
Author

No response yet so it would not consider this "fixed". (Just commenting so the issue will stay open, as it should)

@github-actions github-actions bot removed the Stale Issues/PR that are not getting much activity and are closer to be closed label Jun 22, 2023
@cortinico cortinico added the Never gets stale Prevent issues/PRs from getting stale label Jun 22, 2023
pedropbazzo added a commit to pedropbazzo/react-native-website that referenced this issue Aug 26, 2023
@pedropbazzo
Copy link

#3835 @jobpaardekooper

@jobpaardekooper
Copy link
Author

@pedropbazzo please see my comment on your PR. I don't think it solves this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Never gets stale Prevent issues/PRs from getting stale
Projects
None yet
Development

No branches or pull requests

3 participants