From aca578cb9dfdaed33f91c62ffdf3ef1a456c6a72 Mon Sep 17 00:00:00 2001 From: Haishan Date: Fri, 27 Dec 2019 13:12:49 +0800 Subject: refactor: abstract ButtonWithIcon as a button enhancer --- src/components/Button.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/components/Button.js') diff --git a/src/components/Button.js b/src/components/Button.js index d9bcd22..ce83153 100644 --- a/src/components/Button.js +++ b/src/components/Button.js @@ -6,10 +6,11 @@ const noop = () => {}; const { memo, forwardRef } = React; -function Button({ children, label, onClick = noop }, ref) { +function Button({ children, label, text, start, onClick = noop }, ref) { return ( ); } @@ -22,17 +23,4 @@ export function ButtonPlain({ children, label, onClick = noop }) { ); } -function WithIcon({ text, icon, onClick = noop }, ref) { - return ( - - ); -} - -export const ButtonWithIcon = memo(forwardRef(WithIcon)); - export default memo(forwardRef(Button)); -- cgit v1.3.1