mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-06 07:06:11 +00:00
feat: add Fabric on iOS without ComponentViews (#1821)
Version of #1754 without usage of ComponentViews. It seems like a more proper way, but introduces the necessity of clearing whole state of each component on recycling for it not to be used when view is recycled. Still known problems: We stringify props of type NumberProp since codegen only accepts props of a single type. It is the fastest way of dealing with it, but maybe there could be a better way to handle it. Image resolving should be probably handled the same as in RN core SvgView needs to set opaque = NO so it is does not have black background (it comes from the fact that RCTViewComponentView overrides backgroundColor setter which in turn somehow messes with the view being opaque). All other svg components do it already so maybe it is not such an issue. transform prop won't work when set natively since it is not parsed in Fabric
This commit is contained in:
@@ -6,10 +6,15 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#import "RNSVGSvgView.h"
|
||||
#import <React/UIView+React.h>
|
||||
#import <React/RCTPointerEvents.h>
|
||||
#import "RNSVGCGFCRule.h"
|
||||
#import "RNSVGSvgView.h"
|
||||
|
||||
#ifdef RN_FABRIC_ENABLED
|
||||
#import <React/RCTViewComponentView.h>
|
||||
#endif // RN_FABRIC_ENABLED
|
||||
|
||||
@class RNSVGGroup;
|
||||
|
||||
/**
|
||||
@@ -17,8 +22,12 @@
|
||||
*interfaces for all non-definition nodes.
|
||||
*/
|
||||
|
||||
@interface RNSVGNode : RNSVGView
|
||||
|
||||
@interface RNSVGNode :
|
||||
#ifdef RN_FABRIC_ENABLED
|
||||
RCTViewComponentView
|
||||
#else
|
||||
RNSVGView
|
||||
#endif // RN_FABRIC_ENABLED
|
||||
/*
|
||||
N[1/Sqrt[2], 36]
|
||||
The inverse of the square root of 2.
|
||||
@@ -36,6 +45,7 @@ extern CGFloat const RNSVG_DEFAULT_FONT_SIZE;
|
||||
@property (nonatomic, strong) NSString *markerStart;
|
||||
@property (nonatomic, strong) NSString *markerMid;
|
||||
@property (nonatomic, strong) NSString *markerEnd;
|
||||
@property (nonatomic, strong) RNSVGPlatformView *parentComponentView;
|
||||
|
||||
/**
|
||||
* Used to control how touch events are processed.
|
||||
|
||||
Reference in New Issue
Block a user