benwinding / react-admin-firebase-demo

Demo project for the react-admin-firebase npm package

Home Page:https://benwinding.github.io/react-admin-firebase-demo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to get simpleform data on save button click

ravi-pandit14 opened this issue · comments

Description: I am configured react-admin in my react web app. I want to invite user with email but not getting 'email' and 'role' field in console.

Issue: I am unable to get simpleform data on save button click. I have create custom toolbar in simpleform and only get privious data.

My code

const UserCreate = (props) => (
    <Create title="Invite" {...props} >
        <SimpleForm toolbar={<EditFormToolbar />}>
            <TextInput source="email" />
            <SelectInput source="role" choices={constants.role_choices} optionText="role_name" optionValue="id" />
        </SimpleForm>
    </Create>
);
const inviteUser = (props) => {
    console.log("inviteUser props:", props)
}

const FormToolbar = (props) =>
    (
        <Toolbar {...props} >
            <SaveButton
                label="Invite"
                redirect={false}
                // handleSubmit={handleSubmit}
                // submitOnEnter={true}
                handleSubmitWithRedirect={() => inviteUser(props)}
            />
        </Toolbar>
    );

const EditFormToolbar = compose(
    withFirebase,
)(FormToolbar);
export default withFirebase(UserCreate);
export { EditFormToolbar }