File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ class ControlApp extends React.Component {
69
69
< Radio value= " strawberry" onClick= {this .onClick } > Strawberry< / Radio>
70
70
< / Col>
71
71
< / Row>
72
+ < Row> Just simple context< / Row>
72
73
< / RadioGroup>
73
74
< / div>
74
75
);
Original file line number Diff line number Diff line change @@ -188,16 +188,20 @@ class RadioGroup extends Component {
188
188
( index === 0 && ! this . state . value ) || checked ? 0 : - 1 ;
189
189
const childrtl =
190
190
child . props . rtl === undefined ? rtl : child . props . rtl ;
191
- return React . cloneElement (
192
- child ,
193
- child . props . tabIndex === undefined
194
- ? {
195
- checked,
196
- tabIndex,
197
- rtl : childrtl ,
198
- }
199
- : { checked, rtl : childrtl }
200
- ) ;
191
+ if (
192
+ child . type &&
193
+ child . type . displayName === 'Config(Radio)'
194
+ ) {
195
+ return React . cloneElement ( child , {
196
+ checked,
197
+ tabIndex,
198
+ rtl : childrtl ,
199
+ } ) ;
200
+ }
201
+ return React . cloneElement ( child , {
202
+ checked,
203
+ rtl : childrtl ,
204
+ } ) ;
201
205
}
202
206
) ;
203
207
} else {
You can’t perform that action at this time.
0 commit comments