mirror of
https://github.com/status-im/react-native-linear-gradient.git
synced 2026-08-30 22:01:13 +00:00
A recent commit in RN added start/end properties to RCTViewManager. Because LinearGradient inherits from this class and has properties of the same name, RN gets mixed up and tries to convert to a YGValue instead of CGPoint, which results in the exception: ``` Error setting property 'start' of BVLinearGradient with tag #18: JSON value '{ x = 0; y = 0; }' of type NSMutableDictionary cannot be converted to a YGValue. ```
27 lines
514 B
Objective-C
27 lines
514 B
Objective-C
#import "BVLinearGradientManager.h"
|
|
#import "BVLinearGradient.h"
|
|
#import <React/RCTBridge.h>
|
|
|
|
@implementation BVLinearGradientManager
|
|
|
|
RCT_EXPORT_MODULE();
|
|
|
|
@synthesize bridge = _bridge;
|
|
|
|
- (UIView *)view
|
|
{
|
|
return [[BVLinearGradient alloc] init];
|
|
}
|
|
|
|
- (dispatch_queue_t)methodQueue
|
|
{
|
|
return dispatch_get_main_queue();
|
|
}
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(colors, NSArray);
|
|
RCT_EXPORT_VIEW_PROPERTY(startPoint, CGPoint);
|
|
RCT_EXPORT_VIEW_PROPERTY(endPoint, CGPoint);
|
|
RCT_EXPORT_VIEW_PROPERTY(locations, NSArray);
|
|
|
|
@end
|