@@ -145,22 +145,34 @@ - (RCTPropBlock)propBlockForKey:(NSString *)name
145145 // Check for custom setter
146146 if ([keyPath isEqualToString: @" __custom__" ]) {
147147
148- // Get custom setter
149- SEL customSetter = NSSelectorFromString ([NSString stringWithFormat: @" set_%@ :for%@ View:withDefaultView:" , name, shadowView ? @" Shadow" : @" " ]);
148+ // Get custom setter. There is no default view in the shadow case, so the selector is different.
149+ NSString *selectorString;
150+ if (!shadowView) {
151+ selectorString = [NSString stringWithFormat: @" set_%@ :for%@ View:withDefaultView:" , name, shadowView ? @" Shadow" : @" " ];
152+ } else {
153+ selectorString = [NSString stringWithFormat: @" set_%@ :forShadowView:" , name];
154+ }
155+ SEL customSetter = NSSelectorFromString (selectorString);
150156
151157 propBlock = ^(id <RCTComponent> view, id json) {
152158 RCTComponentData *strongSelf = weakSelf;
153159 if (!strongSelf) {
154160 return ;
155161 }
156162 json = RCTNilIfNull (json);
157- if (!json && !strongSelf->_defaultView ) {
158- // Only create default view if json is null
159- strongSelf->_defaultView = [strongSelf createViewWithTag: nil ];
163+ if (!shadowView) {
164+ if (!json && !strongSelf->_defaultView ) {
165+ // Only create default view if json is null
166+ strongSelf->_defaultView = [strongSelf createViewWithTag: nil ];
167+ }
168+ ((void (*)(id , SEL , id , id , id ))objc_msgSend)(
169+ strongSelf.manager , customSetter, json, view, strongSelf->_defaultView
170+ );
171+ } else {
172+ ((void (*)(id , SEL , id , id ))objc_msgSend)(
173+ strongSelf.manager , customSetter, json, view
174+ );
160175 }
161- ((void (*)(id , SEL , id , id , id ))objc_msgSend)(
162- strongSelf.manager , customSetter, json, view, strongSelf->_defaultView
163- );
164176 };
165177
166178 } else {
0 commit comments