fix(toolbox): Defensively check classNames when mapping button attributes
This commit is contained in:
parent
2f3706bd37
commit
816eef1702
|
@ -21,13 +21,9 @@ export { abstractMapStateToProps } from './functions.native';
|
|||
*/
|
||||
export function getButtonAttributesByProps(props: Object = {})
|
||||
: MapOfAttributes {
|
||||
let classNames = props.classNames;
|
||||
|
||||
if (classNames) {
|
||||
// XXX Make sure to not modify props.classNames because that'd be bad
|
||||
// practice.
|
||||
classNames = [ ...classNames ];
|
||||
}
|
||||
// XXX Make sure to not modify props.classNames because that'd be bad
|
||||
// practice.
|
||||
const classNames = (props.classNames && [ ...props.classNames ]) || [];
|
||||
|
||||
props.toggled && classNames.push('toggled');
|
||||
props.unclickable && classNames.push('unclickable');
|
||||
|
|
Loading…
Reference in New Issue