useTreeEventsHandler Function

Deprecated  in 4.9.0. This hook does not work correctly in React 18 Strict mode. Use useControlledTreeEventsHandler instead.

Custom hook which creates and takes care of disposing a TreeEventsHandler. The input is either a factory method for a custom TreeEventHandler implementation or parameters for the default implementation.

useTreeEventsHandler<TEventsHandler extends TreeEventHandler>(factoryOrParams: TreeEventHandlerParams | () => TEventsHandler): TreeEventHandler

@note Caller must ensure factoryOrParams changes only when a new handler needs to be created. useCallback or useMemo can be used for that purpose based on whether the input is a factory function or params object.

Parameter Type Description
factoryOrParams TreeEventHandlerParams | () => TEventsHandler  

Returns - TreeEventHandler

Defined in

Last Updated: 14 November, 2024