My code for a website of forum (blog) as followed :
import { AUTH } from '../actionTypes/actionTypes';
import * as api from '../api';
export default signin (formData, history) = async (dispatch) => {
try {
const { data } = await api.signIn(formData);
dispatch({ type: AUTH, data });
history.push('/');
} catch (error) {
console.log(error);
}
};
but I receive this error , line (4):
"ReferenceError: Invalid left-hand side in assignment"
How to fix it?
I changed default by const , and added the "=" after signin and it worked !! thank you all