-
Notifications
You must be signed in to change notification settings - Fork 734
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
Conversation
@M-i-k-e-l |
src/commons/withScrollReached.tsx
Outdated
scrollReachedProps: ScrollReachedProps; | ||
ref?: any; | ||
}; | ||
type PropTypes = ForwardRefInjectedProps & SupportedViews; |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
withScrollReached (new HOC) - notifies when start\end of scroll (ScrollView\FlatList) has been reached.