title: react-admin - How to set input values based on another
body: <p>i'm trying to create a ZIP code input that loads street, state and city values automatically in a Create form using React-Admin. How can I populate the inputs based on the <code>onBlur</code> event of the zip code input?
  The best result i achieved is the following scenario:</p>
  
  <p>I created a custom component that has 4 Inputs: zip code (in my country is called CEP), street address, state and city. Then I added an <code>onBlur</code> event on the zip input and set the value on the inputs based on state attributes. Here is the code</p>
  
  <pre><code>class CustomAddressInput extends React.Component {
    constructor(props){
      super(props);
      this.state = {
        cep : '',
        address : '',
        uf : '',
        city : '',
      }
      this.setAddress = this.setAddress.bind(this);
    }
    setAddress(e){
      if(e.target.value != undefined){
        endereco(e.target.value).then((result)=&gt;{
          this.setState({
            cep: result.cep,
            address: result.logradouro,
            uf: result.uf,
            city: result.localidade
          });
        });
      }
    }
  
    render() {
      const { classes } = this.props;
      return (
        &lt;TextInput label="CEP" source="cep" onBlur={(e) =&gt; this.setAddress(e)} defaultValue={this.state.cep} /&gt;
        &lt;TextInput label="Endereco" source="address" defaultValue={this.state.address}/&gt;
        &lt;SelectInput label="Estado" source="state" choices={stateList} defaultValue={this.state.uf}/&gt;
        &lt;TextInput label="Cidade" source="city" defaultValue={this.state.city}/&gt;
      );
    }
  }
  export default withStyles(styles)(CustomAddressInput);
  </code></pre>
  
  <p>And i'm using it on a Create</p>
  
  <pre><code>...
  &lt;Create {...props}&gt;
    &lt;SimpleForm&gt;
      &lt;TextInput label="Nome" source="name"/&gt;
      &lt;TextInput label="CPF/CNPJ" source="cpfcnpj"/&gt;
      &lt;TextInput label="Email" source="email"/&gt;
      &lt;TextInput label="Senha" source="password" type="password" /&gt;
      &lt;TextInput label="Telefone" source="phone" type="tel"/&gt;
      &lt;CustomAddressInput/&gt;
      &lt;BooleanInput label="Pode criar outros usuários do sistema" source="canCreateUser" defaultValue={false}/&gt;
      &lt;BooleanInput label="Pode gerenciar projetos" source="canCreateProjects" defaultValue={false}/&gt;
      &lt;BooleanInput label="Pode visualizar honorários" source="canSeeFees" defaultValue={false}/&gt;
    &lt;/SimpleForm&gt;
  &lt;/Create&gt;
  ...
  </code></pre>
  
  <p>I know i'm setting the values in a wrong way because when the values are set, all the create form is wiped. What should i do? I'm not familiar developing with React.
  Thanks in advance</p>