Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How to fix error "Types of parameters 'state' and 'state' are incompatible"

$
0
0

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 incompatibleenter image description here

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 !


Viewing all articles
Browse latest Browse all 6287

Trending Articles