Skip to content

Commit

Permalink
feat: test
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyair committed Mar 15, 2024
1 parent ebb6a7b commit 359d35e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 10 additions & 2 deletions docs/examples/multiple.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const RangeInput = ({
value?: string[];
onChange?: (value: string[]) => void;
}) => {
if (!Array.isArray(value)) {
return <div>{JSON.stringify(value)}</div>;
}
const [one, two] = value;

return (
Expand All @@ -26,10 +29,15 @@ export default () => {
<>
<Form
form={form}
initialValues={{ one: '11', two: '22' }}
// initialValues={{ one: '11', two: '22' }}
onFinish={v => console.log('submit values', v)}
onFinishFailed={v => console.log('submit values', v)}
>
<Field<FieldType> names={['one', 'two']}>
<Field<FieldType>
names={['one', 'two']}
// name={['one']}
rules={[{ required: true }]}
>
<RangeInput />
</Field>
{/* <Field<FieldType> name="two">
Expand Down
1 change: 0 additions & 1 deletion src/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ function WrapperField<Values = any>({ name, names, ...restProps }: FieldProps<Va
) {
warning(false, '`preserve` should not apply on Form.List fields.');
}

return (
<Field
key={key}
Expand Down

0 comments on commit 359d35e

Please sign in to comment.