import React, { FC, useState } from 'react'; import CurrencyInput from '../components/CurrencyInput'; import { CurrencyInputProps } from '../components/CurrencyInputProps'; const options: ReadonlyArray = [ { locale: 'de-DE', currency: 'EUR', }, { locale: 'en-US', currency: 'USD', }, { locale: 'en-GB', currency: 'GBP', }, { locale: 'ja-JP', currency: 'JPY', }, { locale: 'en-IN', currency: 'INR', }, ]; export const Example3: FC = () => { const [intlConfig, setIntlConfig] = useState(options[0]); const [value, setValue] = useState('123'); const [rawValue, setRawValue] = useState(' '); const handleOnValueChange = (value: string | undefined): void => { setRawValue(value === undefined ? 'undefined' : value || ' '); setValue(value); }; const handleIntlSelect = (event: React.ChangeEvent) => { const config = options[Number(event.target.value)]; if (config) { setIntlConfig(config); } }; return (

Example 3

  • Intl config
              
onValueChange:
{rawValue}
intlConfig:
{JSON.stringify(intlConfig)}
); }; export default Example3;