We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to signup using an API and have modified the singup page as below; signup.tsx
const login = async (e: React.FormEvent) => { e.preventDefault(); setFormSubmitted(true); if(!firstName) { setUsernameError(true); } if(!password) { setPasswordError(true); } if(username && password) { //await setIsLoggedIn(true); //await setUsernameAction(username); await userRegister(firstName, lastName, email, phone, password, gender); history.push('/', {direction: 'none'}); } };
user.actions.ts
`export const userRegister = (firstName: string, lastName: string, email: string, phone: string, password: string, gender: string) => async (dispatch: React.Dispatch) => {
dispatch(setLoading(true)); const user = await setUserRegisterData(firstName, lastName, email, phone, password, gender); console.log(user); dispatch(setIsLoggedIn(true)); dispatch(setUsername(user.email)); dispatch(setUserRegisterAction(user)); dispatch(setLoading(false));
};
export const setUsername = (username?: string) => async () => { console.log(new Date().toString()); await setUsernameData(username); return ({ type: 'set-username', username } as const); }; `
the console is showing user but no other dispatch function showing the log and working.
Is there any solution?
The text was updated successfully, but these errors were encountered:
Having this exact issue. 2-3 hours of pain later, no solution yet :|
Sorry, something went wrong.
No branches or pull requests
I am trying to signup using an API and have modified the singup page as below;
signup.tsx
const login = async (e: React.FormEvent) => { e.preventDefault(); setFormSubmitted(true); if(!firstName) { setUsernameError(true); } if(!password) { setPasswordError(true); } if(username && password) { //await setIsLoggedIn(true); //await setUsernameAction(username); await userRegister(firstName, lastName, email, phone, password, gender); history.push('/', {direction: 'none'}); } };
user.actions.ts
`export const userRegister = (firstName: string, lastName: string, email: string, phone: string, password: string, gender: string) => async (dispatch: React.Dispatch) => {
dispatch(setLoading(true));
const user = await setUserRegisterData(firstName, lastName, email, phone, password, gender);
console.log(user);
dispatch(setIsLoggedIn(true));
dispatch(setUsername(user.email));
dispatch(setUserRegisterAction(user));
dispatch(setLoading(false));
};
export const setUsername = (username?: string) => async () => {
console.log(new Date().toString());
await setUsernameData(username);
return ({
type: 'set-username',
username
} as const);
};
`
the console is showing user but no other dispatch function showing the log and working.
Is there any solution?
The text was updated successfully, but these errors were encountered: