How to use use-callback-ref - 1 common examples

To help you get started, we’ve selected a few use-callback-ref examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github theKashey / react-remove-scroll / src / UI.tsx View on Github external
children,
    className,
    removeScrollBar,
    enabled,
    shards,
    sideCar,
    noIsolation,
    inert,
    allowPinchZoom,
    ...rest
  } = props;

  const SideCar: SideCarComponent<IRemoveScrollEffectProps> = sideCar;

  const containerProps = {
    ref: useMergeRefs<any>([
      ref,
      parentRef as React.MutableRefObject<HTMLElement>
    ]),
    ...rest,
    ...callbacks
  };

  return (
    <React.Fragment>
      {enabled && (
        <SideCar
          sideCar={effectCar}
          removeScrollBar={removeScrollBar}
          shards={shards}
          noIsolation={noIsolation}
          inert={inert}

use-callback-ref

The same useRef, but with callback

MIT
Latest version published 8 months ago

Package Health Score

76 / 100
Full package analysis

Popular use-callback-ref functions