react-input icon indicating copy to clipboard operation
react-input copied to clipboard

initial value is not formatted

Open vrubliuk opened this issue 4 months ago • 0 comments

import { useNumberFormat, InputNumberFormat } from "@react-input/number-format";
import { useState } from "react";

function App() {
  const inputRef = useNumberFormat({ locales: "en", minimumFractionDigits: 2 });
  const [value, setValue] = useState("10000");

  return (
    <input
      ref={inputRef}
      value={value}
      onChange={(e) => setValue(e.target.value)}
    />
  );
}

// expected initial value in the input: "10,000.00"
// actual initial value in the input: "10000"

vrubliuk avatar Oct 04 '24 13:10 vrubliuk