No overload matches this call. Overload 1 of 2,
The state needs to be abit more strongly typed. Its trying to cast your initial state from type any
to type never
.
When creating the default state for the data you should define an interface for your state, here's an example for a todo list array:
interface IAppState {
toDoList: any[];
}
const initialState: IAppState = {
toDoList: []
};
export default function reducer(state = initialState, action) {}
For future googlers:
This is also the error returned if you forget to call your function with the same inputs as used in the function definition.
Example:
const handleSaveAll = (currRow: MyItem, fileToUpload: File | undefined) => {
//all the stuff the function does
});
The Error:
<Button className={style.btnSave} onClick={handleSaveAll}>
The Fix:
<Button className={style.btnSave} onClick={() => handleSaveAll(currRow, fileToUpload)}>