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

fix: header config missing ref #2434

Merged
merged 2 commits into from
Oct 23, 2024
Merged

fix: header config missing ref #2434

merged 2 commits into from
Oct 23, 2024

Conversation

alduzy
Copy link
Member

@alduzy alduzy commented Oct 22, 2024

Description

This PR changes ScreenStackHeaderConfig into a forwardRef.

This is needed if you want to attach ref to it, which react-native-reanimated needs to do here in order to migrate to v4, since the header config is now a function component and cannot be used directly anymore.

Without this change the app crashes with Cannot read property 'getScrollableNode' of null.

Related PR: software-mansion/react-native-reanimated#6622

Checklist

  • Ensured that CI passes

Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

I'm not really into typescript magic, however isn't it main way to use forwardRef for function components?

@alduzy
Copy link
Member Author

alduzy commented Oct 22, 2024

@kkafar I adjusted it just so it can be used in a forwardRef, but generally speaking you're right. I'll change it in both PRs to match this convention.

@alduzy alduzy requested a review from kkafar October 22, 2024 16:03
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

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

I think we are good. Thanks!

@alduzy alduzy merged commit b74e0eb into main Oct 23, 2024
3 checks passed
@alduzy alduzy deleted the @alduzy/reanimated-patch branch October 23, 2024 09:34
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.

3 participants