Fix radio buttons using stale props in Fiber (#9126)
D4662269
Ben Alpert committed
Mar 6, 2017 at 14:58 UTC
678cb70da2750988dd048cb63aa8d94269b387d0
1 file changed
+3
-3
src/renderers/dom/fiber/wrappers/ReactDOMFiberInput.js
+3
-3
@@ -292,16 +292,16 @@ function updateNamedCousins(rootNode, props) {
292
// and the same name are rendered into the same form (same as #1939).
293
// That's probably okay; we don't support it just as we don't support
294
// mixing React radio buttons with non-React ones.
295
- var otherInstance = ReactDOMComponentTree.getInstanceFromNode(otherNode);
295
+ var otherProps = ReactDOMComponentTree.getFiberCurrentPropsFromNode(otherNode);
296
invariant(
297
- otherInstance,
297
+ otherProps,
298
'ReactDOMInput: Mixing React and non-React radio inputs with the ' +
299
'same `name` is not supported.'
300
);
301
// If this is a controlled radio button group, forcing the input that
302
// was previously checked to update will cause it to be come re-checked
303
// as appropriate.
304
- ReactDOMInput.updateWrapper(otherNode, otherInstance.memoizedProps);
304
+ ReactDOMInput.updateWrapper(otherNode, otherProps);
305
}
306
}
307
}