mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
support optional numbers
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
export const numberValue = (value: number) => (isNaN(value) ? '' : value.toString());
|
||||
export const numberValue = (value?: number) => {
|
||||
if (value !== undefined) {
|
||||
return isNaN(value) ? '' : value.toString();
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
export const extractEventValue = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
switch (event.target.type) {
|
||||
|
||||
Reference in New Issue
Block a user