Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Use memoization
dominik-zeglen977165059efe
diff --git a/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx b/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsxindex 63dd179890..31c23d9cef 100644--- a/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx+++ b/saleor/static/dashboard-next/components/Checkbox/Checkbox.tsx@@ -91,20 +91,23 @@ const Checkbox = withStyles(styles, { name: "Checkbox" })(...props}: CheckboxProps & WithStyles<typeof styles>) => {const inputRef = React.useRef<HTMLInputElement>(null);+ const handleClick = React.useCallback(+ disableClickPropagation+ ? event => {+ event.stopPropagation();+ inputRef.current.click();+ }+ : () => inputRef.current.click(),+ []+ );+return (<ButtonBase{...props}centerRippleclassName={classNames(classes.root, className)}disabled={disabled}- onClick={- disableClickPropagation- ? event => {- event.stopPropagation();- inputRef.current.click();- }- : () => inputRef.current.click()- }+ onClick={handleClick}><inputclassName={classNames(classes.box, {