How to use the simplebar/dist/simplebar-core.esm function in simplebar

To help you get started, we’ve selected a few simplebar 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 Grsmto / simplebar / packages / simplebar-react / index.js View on Github external
useEffect(() => {
      const scrollableNodeRef = scrollableNodeProps.ref || scrollableNodeRef;

      if (elRef.current) {
        instance = new SimpleBarJS(elRef.current, {
          ...getOptions(deprecatedOptions),
          ...options,
          ...(scrollableNodeRef && {
            scrollableNode: scrollableNodeRef.current
          }),
          ...(contentNodeRef.current && {
            contentNode: contentNodeRef.current
          })
        });

        if (ref) {
          ref.current = instance;
        }
      }

      return () => {