React Hookers - v6.3.0
    Preparing search index...

    Function useFormattedInput

    • Provides behavior for a text input that allows editing a value as formatted text.

      Type Parameters

      • V

        An input value.

      Parameters

      Returns FormattedInputValue<V>

      const [value, setValue] = useState<number>();

      const numberInputHandler = useMemo(
      () => new NumberInputHandler(new Intl.NumberFormat('en')),
      []
      );

      const { inputProps } = useFormattedNumber({
      value,
      onChange: setValue,
      handler: numberInputHandler,
      });

      <input {...inputProps} />