-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Anton Lebedev edited this page Nov 18, 2022
·
8 revisions
▸ MaskedField<Name
>(props
): Element
A component for helping the user entering some text by configured mask.
Input pattern is determined by mask parameter. The user's text input is controlled by source parameter.
Name | Type |
---|---|
Name |
extends string
|
Name | Type |
---|---|
props |
Props <Name > |
Element
▸ NumberField<Name
>(props
): Element
Number field component
Name | Type |
---|---|
Name |
extends string
|
Name | Type |
---|---|
props |
Props <Name > |
Element
▸ TextField<Name
>(props
): Element
Text field component
Name | Type |
---|---|
Name |
extends string
|
Name | Type |
---|---|
props |
Props <Name > |
Element
▸ useForm<Data
>(initialData
): [Data
, Dispatch
<Exclude
<{ [K in string | number | symbol]: Pick<Data, K> }[keyof Data
], undefined
>>]
Returns form data and a reducer action to update data key
const [data, setData] = useForm({
name: 'John',
surname: 'Doe'
});
return (
<TextField value={data.name} onChange={setData}/>
);
Name | Type |
---|---|
Data |
extends AbstractData = AbstractData
|
Name | Type |
---|---|
initialData |
Data |
[Data
, Dispatch
<Exclude
<{ [K in string | number | symbol]: Pick<Data, K> }[keyof Data
], undefined
>>]
Ƭ AbstractData: Record
<string
, unknown
>
Abstract form data interface