const [value, setValue] = useState('');
const numpadPressHandler = useCallback(value => {
setValue(value);
}, []);
<NumpadOutput value={value} />
<Numpad onPress={numpadPressHandler} />
Props
Numpad
Prop | Type | Default | Description |
---|---|---|---|
onPress | func | () => {} | |
decimal | bool | true | Renders an additional period button to support decimal input |