내가 mobx이-반응-에서 사용하고 그리고 난 AA 문제가 onSubmit 구현하는 방법폼 반응 Mobx - .... 사용자가 내가 obSubmit 후크 안에 내 상점에서이 작업을 사용하는 방법을 파악하는
mobx 양식 내가 입력 및 검증 을 볼 수 있습니다 .. 확인 작업을하고 난 양식을 제출하면 내가 원하는 건 ... 가게에서 작업을 사용하는 것입니다
내 AutStore 파일 :import {observable,action} from 'mobx';
class AuthStore {
constructor(store) {
this.store = store
}
@action authLogin=(form)=>{
this.store.firebaseAuth.signInWithEmailAndPassword().then(()=>{
}).catch(()=>{
})
}
}
export default AuthStore
내 AuthForm 파일 :
import {observable, action} from 'mobx';
import MobxReactForm from 'mobx-react-form';
import {formFields,formValidation} from './formSettings';
const fields = [
formFields.email,
formFields.password
];
const hooks = {
onSuccess(form) {
// Here i want to use an action - authLogin from my AuthStore
console.log('Form Values!', form.values());
},
onError(form) {
console.log('All form errors', form.errors());
}
};
const AuthForm = new MobxReactForm({fields}, {plugins:formValidation,
hooks});
export default AuthForm
나는 어떻게 내가 모두 함께 감사 할 수 있는지 알고 싶다 !!!
와우! 덕분에 많은 도움이되었습니다. –