Answers for "hide input based on value of another input"

0

hide input based on value of another input

//hide input based on value of another input
import { FormDataConsumer } from 'react-admin';

 const PostEdit = () => (
     <Edit>
         <SimpleForm>
             <BooleanInput source="hasEmail" />
             <FormDataConsumer>
                 {({ formData, ...rest }) => formData.hasEmail &&
                      <TextInput source="email" {...rest} />
                 }
             </FormDataConsumer>
         </SimpleForm>
     </Edit>
 );
Posted by: Guest on April-28-2022

Code answers related to "hide input based on value of another input"

Browse Popular Code Answers by Language