How to use the @react-md/utils.applyRef function in @react-md/utils

To help you get started, we’ve selected a few @react-md/utils 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 mlaursen / react-md / packages / form / src / useTextAreaHeightAnimation.ts View on Github external
(instance: HTMLTextAreaElement | null) => {
      applyRef(instance, ref);

      if (instance) {
        update(instance.value);
      }
    },
    [ref]
github mlaursen / react-md / packages / divider / src / VerticalDivider.tsx View on Github external
(instance: HTMLDivElement | null) => {
      applyRef(instance, forwardedRef);
      if (!instance || !instance.parentElement) {
        return;
      }

      const height = instance.parentElement.offsetHeight;
      if (maxHeight <= 1) {
        setHeight(height * maxHeight);
      } else {
        setHeight(Math.min(height, maxHeight));
      }
    },
    [maxHeight, forwardedRef]
github mlaursen / react-md / packages / tabs / src / useTabIndicatorStyle.ts View on Github external
(instance: HTMLDivElement | null) => {
      applyRef(instance, ref);
      tabsRef.current = instance;
    },
    [ref]
github mlaursen / react-md / packages / form / src / text-field / TextArea.tsx View on Github external
(instance: HTMLTextAreaElement | null) => {
      applyRef(instance, forwardedRef);
      areaRef.current = instance;
    },
    [forwardedRef]
github mlaursen / react-md / packages / menu / src / useMenuRef.ts View on Github external
(instance: HTMLDivElement | null) => {
      applyRef(instance, ref);
      menu.current = instance;
    },
    [ref]
github mlaursen / react-md / packages / autocomplete / src / useAutoComplete.ts View on Github external
(instance: HTMLInputElement | null) => {
      applyRef(instance, forwardedRef);
      inputRef.current = instance;
    },
    [forwardedRef]
github mlaursen / react-md / packages / form / src / select / Select.tsx View on Github external
(instance: HTMLDivElement | null) => {
      applyRef(instance, forwardedRef);
      selectRef.current = instance;
    },
    [forwardedRef]
github mlaursen / react-md / packages / tabs / src / TabPanels.tsx View on Github external
(instance: HTMLDivElement | null) => {
      applyRef(instance, forwardedRef);
      ref.current = instance;
    },
    [forwardedRef]