Skip to content

Commit 15586b4

Browse files
committed
Add generic to useInput
1 parent 02d516f commit 15586b4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/ra-core/src/form/useInput.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ const defaultFormat = (value: any) => (value == null ? '' : value);
2323
// parse empty string into null as it's more suitable for a majority of backends
2424
const defaultParse = (value: string) => (value === '' ? null : value);
2525

26-
export const useInput = (props: InputProps): UseInputValue => {
26+
export const useInput = <ValueType = any>(
27+
props: InputProps<ValueType>
28+
): UseInputValue => {
2729
const {
2830
defaultValue,
2931
format = defaultFormat,

0 commit comments

Comments
 (0)