Reputation: 67
The Error is: Type '{ id: string; title: string; content: string; }[]' is missing the following properties from type 'InitialState': id, title, contentts(2739)
interface InitialState {
id: string,
title: string,
content: string
}
const initialState:InitialState = [
{id: '1', title: 'post title', content: 'the fack content'},
{id: '1', title: 'post title', content: 'the fack content'},
]
Upvotes: 0
Views: 79
Reputation: 616
Type of initialState
is defined as InitialState
but an array is passed instead. switch the type to be InitialState[]
.
Upvotes: 1