Skip to content

Function: mergeProps() ​

ts
function mergeProps(...all): ReactProps;

Combine React props from several hooks for one element, e.g. a toolbar button with a tooltip. Later props win, except event handlers (onX): handlers for the same event all run, in order.

Parameters ​

ParameterType
...allReactProps[]

Returns ​

ReactProps

Example ​

tsx
<button {...mergeProps(toolbar.getItemProps('bold'), tooltip.getTriggerProps('bold'))} />