From 46ec5b5751eb77e84db1668de7f393cfa06bbd99 Mon Sep 17 00:00:00 2001 From: Zhi-Qiang Lei Date: Thu, 7 Apr 2022 05:59:51 +0800 Subject: [PATCH] Improve type definition --- src/components/currency.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/currency.tsx b/src/components/currency.tsx index 01fd22ef..c14bde07 100644 --- a/src/components/currency.tsx +++ b/src/components/currency.tsx @@ -1,5 +1,5 @@ import { NextPage } from "next" -import { ChangeEvent, useContext } from "react" +import { ChangeEventHandler, useContext } from "react" import NumberFormat from "react-number-format" import { Config, ConfigContext } from "../cardano/config" @@ -22,7 +22,7 @@ const CurrencyInput: NextPage<{ }> = ({ value, onChange, decimals, ...props }) => { const inputValue = toDecimal(value, decimals) - const changeHandle = (event: ChangeEvent) => { + const changeHandle: ChangeEventHandler = (event) => { const [i, f] = event.target.value.split('.', 2) const number = BigInt(i + (f || '0').slice(0, decimals).padEnd(decimals, '0')) onChange(number)