fix(ios): native crashes when using native props #645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A critical issue was introduced by #505 that breaks usage of any of the following props on iOS platform:
permissionsdefaultAudiencenonceIOSloginTrackingIOStooltipBehaviorIOSAttempting to use any of these props will trigger the following runtime native error on mount:
This happens because the view exposed by native is not an instance of
FBSDKLoginButtonanymore, but a new wrapperRCTFBSDKLoginButtonViewintroduced in #505. Therefore, in the variousRCT_EXPORT_VIEW_PROPERTYandRCT_CUSTOM_VIEW_PROPERTYmacros, theviewreferences point to the wrapperRCTFBSDKLoginButtonViewwhich does not implement the properties itself.This commit exposes the underlying
FBSDKLoginButtonproperty on the customRCTFBSDKLoginButtonViewwrapper, and re-exports these props as custom properties with the correct viewClass for correct static type checking.Warning
I am not proficient in Objective-C. This should be extensively tested and checked as I might have made mistakes. Do not assume every use case has been tested!