mirror of
https://github.com/enso-org/enso.git
synced 2024-11-25 02:35:04 +03:00
Memoize Button
This commit is contained in:
parent
6eb7541657
commit
27efdfd257
@ -1,5 +1,6 @@
|
||||
/** @file A styled button. */
|
||||
import {
|
||||
memo,
|
||||
useLayoutEffect,
|
||||
useRef,
|
||||
useState,
|
||||
@ -283,10 +284,8 @@ export const BUTTON_STYLES = tv({
|
||||
})
|
||||
|
||||
/** A button allows a user to perform an action, with mouse, touch, and keyboard interactions. */
|
||||
export const Button = forwardRef(function Button(
|
||||
props: ButtonProps,
|
||||
ref: ForwardedRef<HTMLButtonElement>,
|
||||
) {
|
||||
export const Button = memo(
|
||||
forwardRef(function Button(props: ButtonProps, ref: ForwardedRef<HTMLButtonElement>) {
|
||||
const {
|
||||
className,
|
||||
contentClassName,
|
||||
@ -494,4 +493,5 @@ export const Button = forwardRef(function Button(
|
||||
</Tooltip>
|
||||
</TooltipTrigger>
|
||||
)
|
||||
})
|
||||
}),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user