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

ScrollView "StickyHeaderComponent" prop need documentation #2179

Closed
cheolhow opened this issue Aug 27, 2020 · 4 comments · Fixed by #2482
Closed

ScrollView "StickyHeaderComponent" prop need documentation #2179

cheolhow opened this issue Aug 27, 2020 · 4 comments · Fixed by #2482
Labels
👻 Missing Docs Documentation is missing 👋 Good first issue Interested in collaborating? Take a stab at fixing one of these issues.

Comments

@cheolhow
Copy link

cheolhow commented Aug 27, 2020

Description

facebook/react-native#25428

I found StickyHeaderComponent is available in the latest version RN's ScrollView. But it's not documented.

What is the problem?

There is some ambiguity in understanding just as described in PR.
For example, if I use StickyHeaderComponent with stickyHeaderIndices, it's ambiguous how to handle it.
It similar to CellRenderComponent prop, but it doesn't keep the sticky behavior.

    const Test = styled.View`
      background-color: red;
    `;

    _renderStickyHeaderComponent = ({ children, ...props }) => {
        return <Test {...props}>{children}</Test>
    }

    <Animated.FlatList
        ...props
        stickyHeaderIndices={[1]}
        StickyHeaderComponent={this._renderStickyHeaderComponent}
    />

How can we address it?

Requires documentation and some use-case of StickyHeaderComponent prop

Why is it important?

As explained in the PR link above, the CellRenderComponent prop can not custom ScrollViewStickyHeader , but StickyHeaderComponent property can custom. So it makes us deal with the various situation.

Who needs this?

It's necessary for everyone. Especially for those who need to implement animation in ScrollView, FlatList.

@DZuz14
Copy link

DZuz14 commented Sep 1, 2020

@cheolhow You mention ScrollView in the title of the issue, but your code snippet is that of a FlatList? Which are you having a problem with?

@cheolhow
Copy link
Author

cheolhow commented Sep 1, 2020

@DZuz14 Flatlist is inherits VirtualizedList. And VirtualizedList is inherits ScrollView. Therefore, the issue of ScrollView can be described with FlatList.

@cheolhow
Copy link
Author

cheolhow commented Sep 1, 2020

When I check the ScrollView code, it seems that the StickyHeaderComponent property is completely replaced by a custom component.
I handled the code of the ScrollViewStickyHeader component by customizing the code to maintain the default sticky behavior. However, this process seems to be a temporary measure.
Discussion of improving this part will begin in the react-native repository.
However, it seems that the document still needs notation and explanation for this property.

@Simek Simek added 👻 Missing Docs Documentation is missing 👋 Good first issue Interested in collaborating? Take a stab at fixing one of these issues. labels Nov 3, 2020
@Simek
Copy link
Collaborator

Simek commented Nov 3, 2020

The code, description and types for missing StickyHeaderComponent prop can be found here:

It should be added to the ScrollView page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👻 Missing Docs Documentation is missing 👋 Good first issue Interested in collaborating? Take a stab at fixing one of these issues.
Projects
None yet
3 participants