Skip to content

withScrollReached (new HOC) - notifies when start\end of scroll (ScrollView\FlatList) has been reached #828

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

Merged
merged 12 commits into from
Jul 6, 2020

Conversation

M-i-k-e-l
Copy link
Collaborator

@M-i-k-e-l M-i-k-e-l commented Jun 28, 2020

withScrollReached (new HOC) - notifies when start\end of scroll (ScrollView\FlatList) has been reached.

@ethanshar
Copy link
Collaborator

@M-i-k-e-l
Please add a description or something that can help understand what's this PR is for..
also, as discussed, it would help if the PR title will have a better description that fits a change log

scrollReachedProps: ScrollReachedProps;
ref?: any;
};
type PropTypes = ForwardRefInjectedProps & SupportedViews;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure about the type here?
Basically you're saying that the Wrapped component must be a ScrollView/FlatList?
But isn't it possible the Wrapped component is just a simple View that wraps ScrollView/FlatList ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that what matters is this:
WrappedComponent: React.ComponentType<WithScrollReachedProps>
maybe I should rename this to something else?
BTW, this section is changed because of other warnings\errors, but please let me know if the name (or my thinking) is wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

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

it's not about the name.

I think there's might be something wrong with the types, but maybe i'm missing something, let's take it offline

@@ -0,0 +1,70 @@
import React, {Component} from 'react';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Personally I think that the 3 example screen files makes it a little difficult to understand what's going on.
I think it's a great feature, but still a pretty small one, as a user I'm getting lost in all of these files when I'm trying to figure out how the API works.

Let's simplify it. I don't think there's really a need for showing how it works both on FlatList and ScrollView, the principles are similar, showing only on ScrollView it's good enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, do you want it to be in a single file or a screen + component?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, let's simplify it. It's important that the example screen is easy to understand

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Merged files and removed FlatList

@M-i-k-e-l M-i-k-e-l changed the title withScrollReached - new HOC withScrollReached (new HOC) - notifies when start\end of scroll (ScrollView\FlatList) has been reached Jun 29, 2020
@M-i-k-e-l M-i-k-e-l requested a review from ethanshar June 29, 2020 13:23
@ethanshar ethanshar merged commit 7e66254 into master Jul 6, 2020
@M-i-k-e-l M-i-k-e-l deleted the feat/with-scroll-reached-new-hoc branch September 21, 2020 10:01
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.

2 participants