mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
avoid lambda props
This fixes the simple cases of callback props using lambda functions. This will prevent rerendering in some cases since a new callback function is not created on each call.
This commit is contained in:
@@ -106,7 +106,7 @@ const ActionButton: React.FC<ActionButtonProps> = (props) => {
|
||||
{...tooltipTargetProps}
|
||||
intent={Intent.PRIMARY}
|
||||
onMouseDown={preventFocusOnClick}
|
||||
onClick={() => props.onAction()}
|
||||
onClick={props.onAction}
|
||||
disabled={props.enabled === false}
|
||||
style={
|
||||
props.enabled === false ? { pointerEvents: 'none' } : undefined
|
||||
|
||||
Reference in New Issue
Block a user