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

Calling getNode() on the ref of an Animated component is no longer necessary #18

Closed
pdugan20 opened this issue Jul 5, 2020 · 8 comments

Comments

@pdugan20
Copy link

pdugan20 commented Jul 5, 2020

Getting the following warning on RN 0.62.

FlatList: Calling getNode() on the ref of an Animated component is no longer necessary. You can now directly use the ref instead. This method will be removed in a future release.

@iyegoroff
Copy link
Owner

You can use animatedComponent instead:

public animatedComponent = () => {
return this.wrappedComponent.current
}

@pdugan20
Copy link
Author

pdugan20 commented Jul 5, 2020

Is there a code sample I can look at which describes the correct usage here? Not entirely sure by looking at the documentation how to implement this.

@pdugan20
Copy link
Author

pdugan20 commented Jul 5, 2020

Apologies, but I'm not understanding based on that sample. My implementation looks like this:

<CollapsibleHeaderFlatList
    ref={scrollRef}
    data={hikes}
    extraData={hikes}
    CollapsibleHeaderComponent={<FeedHeader city={city} />}
    headerHeight={35}
    showsVerticalScrollIndicator={false}
    keyExtractor={(item) => item.key}
    renderItem={this.renderItem}
    refreshControl={refreshControl}
    onEndReached={onEndReached}
    ListFooterComponent={this.renderFooter}
    headerContainerBackgroundColor={theme.colors.rootBackground}
    disableHeaderSnap
    bounces
/>

@iyegoroff
Copy link
Owner

I didn't get what do you want to achieve - just use animatedComponent method instead of getNode.

@pdugan20
Copy link
Author

pdugan20 commented Jul 5, 2020

I'm not calling getNode() anywhere though, so I'm confused as to how I should implement animatedComponent(). Upgrading to RN 0.62 started throwing the warning whenever a CollapsibleHeaderFlatList is loaded.

@iyegoroff
Copy link
Owner

If you are not calling getNode, then it is not related to rnchv. getNode is not called from the module.

@pdugan20
Copy link
Author

pdugan20 commented Jul 5, 2020

Oh you're totally right, this is a react-navigation issue. Thanks for your help and for the great package!

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

No branches or pull requests

2 participants