@atlaskit/button
Version:
A button triggers an event or action. They let users know what will happen next.
16 lines • 675 B
JavaScript
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
import { Children } from 'react';
export var getActions = function getActions(children) {
var _Children$toArray = Children.toArray(children),
_Children$toArray2 = _slicedToArray(_Children$toArray, 2),
PrimaryAction = _Children$toArray2[0],
SecondaryAction = _Children$toArray2[1];
if (typeof process !== 'undefined' && process.env.NODE_ENV === 'development' && (!PrimaryAction || !SecondaryAction)) {
// TODO: i18n?
throw new SyntaxError('SplitButton requires two children to be provided');
}
return {
PrimaryAction: PrimaryAction,
SecondaryAction: SecondaryAction
};
};