mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-19 21:41:52 +08:00
removed viewWithProps: from RCTViewManager
Summary: public An option to create a different view based on passed in props is no longer necessary. I'm removing it, since the idea of creating a view based on set of initial properies is a bit flawed, since we cannot change it to another view later when props are changed. (This API really made sense mostly in case where some of the props on component were not meant to be changed later, which is a bit weird limitation on a prop.) Reviewed By: nicklockwood Differential Revision: D2769206 fb-gh-sync-id: 190a4f5f31ee84085b1ec945b5d99746f39e8e4b
This commit is contained in:
committed by
facebook-github-bot-5
parent
d359c01f53
commit
45e0423b4e
@@ -81,7 +81,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
{
|
||||
RCTAssertMainThread();
|
||||
|
||||
UIView *view = (UIView *)(props ? [self.manager viewWithProps:props] : [_manager view]);
|
||||
UIView *view = [_manager view];
|
||||
view.reactTag = tag;
|
||||
view.multipleTouchEnabled = YES;
|
||||
view.userInteractionEnabled = YES; // required for touch handling
|
||||
|
||||
@@ -41,15 +41,6 @@ typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, NSDictionary<NSNu
|
||||
*/
|
||||
- (UIView *)view;
|
||||
|
||||
/**
|
||||
* This method instantiates a native view using the props passed into the component.
|
||||
* This method should be used when you need to know about specific props in order to
|
||||
* initialize a view. By default, this just calls the -view method. Each prop will
|
||||
* still be set individually, after the view is created. Like the -view method,
|
||||
* -viewWithProps: should return a fresh instance each time it is called.
|
||||
*/
|
||||
- (UIView *)viewWithProps:(NSDictionary<NSString *, id> *)props;
|
||||
|
||||
/**
|
||||
* This method instantiates a shadow view to be managed by the module. If omitted,
|
||||
* an ordinary RCTShadowView instance will be created, which is typically fine for
|
||||
|
||||
@@ -55,11 +55,6 @@ RCT_EXPORT_MODULE()
|
||||
return _bridge.uiManager.methodQueue;
|
||||
}
|
||||
|
||||
- (UIView *)viewWithProps:(__unused NSDictionary<NSString *, id> *)props
|
||||
{
|
||||
return [self view];
|
||||
}
|
||||
|
||||
- (UIView *)view
|
||||
{
|
||||
return [RCTView new];
|
||||
|
||||
Reference in New Issue
Block a user