I recently passed my react native project to typescript and i have this error and i don't find how to fix it.The error is :Types of parameters 'state' and 'state' are incompatible
This is the authentication reducer :
const initialState = { credentials: { Username: '', Password: '', }, LoggedIn: false,};function authentication(state = initialState, action: any) { switch (action.type) { case userConstants.LOGIN_REQUEST: return { credentials: action.credentials, }; case userConstants.LOGIN_SUCCESS: return { state }; default: return state; }}export default authentication;
Thank you in advance for your help !