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: RN 0.76 fabric compatibility #889

Closed
wants to merge 1 commit into from
Closed

Conversation

vonovak
Copy link
Contributor

@vonovak vonovak commented Oct 17, 2024

Summary

edit: this won't be needed after facebook/react-native#47086

As it is, the project won't build with new architecture on RN 0.76 because the ViewManagerDelegate interface has been refactored to Kotlin and the commandId is now a non-nullable String.

This PR changes the override fun receiveCommand signature to use non-nullable String too.

This is backward-compatible because the overridden function is defined in a Java base class and

override fun receiveCommand(root: NestedScrollableHost, commandId: String, args: ReadableArray?)
override fun receiveCommand(root: NestedScrollableHost, commandId: String?, args: ReadableArray?)

are both valid overrides of Java in Kotlin.

The fix (and the assumption)

Changing to a non-nullable String complies with the ViewManagerDelegate.kt interface and should also be future-compatible because if at some point the base class is also Kotlinified this will still work - assuming that the current Java signature public void receiveCommand(@NonNull T root, String commandId, @Nullable ReadableArray args) becomes open ... fun receiveCommand(root: NestedScrollableHost, commandId: String, args: ReadableArray?) (i.e. the string won't be nullable, in line with how it's defined in ViewManagerDelegate.kt).

Test Plan

TODO

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS ✅❌
Android ✅❌

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I updated the typed files (TS and Flow)

@MrRefactor MrRefactor closed this Nov 9, 2024
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