Skip to content

Commit

Permalink
Fix component type comparison in dev mode withh HMR enabled
Browse files Browse the repository at this point in the history
Type comparison works fine in production, but fails in dev mode with hot module replacement (HMR) enabled. This is documented in detail at: gaearon/react-hot-loader#304
  • Loading branch information
sarathms committed May 29, 2019
1 parent 3a3a5cd commit 98f3c02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/atoms/Radio.js
Expand Up @@ -18,7 +18,7 @@ export class RadioGroup extends React.Component {
return (
<div>
{React.Children.map(children, child => (
!(child.type === RadioButton)
!(child.type.name === RadioButton.name)
? child
: React.cloneElement(child, {
checked: child.props.value === value,
Expand Down

0 comments on commit 98f3c02

Please sign in to comment.