Closed Talor-A closed 6 years ago
@Talor-A The data should be available with loginForm
i.e, this.props.loginForm.email
.
ah ok. is there any particular reason the form isn't using the redux-form
onSubmit prop?
@Talor-A The Form
component being used there is NativeBase component. onSubmit prop is not available to it. And we also wanted to add a Toast to show the error message for the form.
@shivrajkumar so to access email and password inside LoginContainer
login()
method I could put
const form = (
<Form>
...
</Form>
)
return <Login loginForm={form} onLogin={() => this.login(form)} />
in my render() method? and then in login() method:
login = (form) => {
console.warn(`Email: ${form.email}, Password: ${form.password}`)
...
}
is this correct? I'm getting email and password undefined in the console.warn
statement.
@Talor-A email
and password
data is not available with redux form example here. I was talking about mobX and MST variation. Sorry about the confusion.
You can get the values using onChange
function on Input and use them as needed.
Check https://github.com/erikras/redux-form for further details.
hi, how can I get the login data (email and password) and use it in the login function to login with my server?