2

How do we set the default value for ArrayInput in react admin ? I tried without success

<ArrayInput source="to" defaultValue={[{email: '[email protected]'}]}>
    <SimpleFormIterator>
        <TextInput source="email" {...rest} />
    </SimpleFormIterator>
</ArrayInput>
1

1 Answer 1

2

Your code seems to be correct.

I reproduced the issue in a CodeSandbox and I filled an issue for you:

EDIT: The issue has been resolved and is available on the version 2.2.0 as shown by the following sandbox: https://codesandbox.io/s/4z383v368x

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.