The problem was in the props passed to the target component Dialogs. It was like this:
type DialogsProps = {
dialogs: Array<{id: number, name: string}>,
messages: Array<{id: number, messageText: string}>,
sendMessage: (messageText: string) => void
}
I changed it to the type used in the reducer:
type DialogType = {
id: IdType,
name: string
} type MessageType = {
id: IdType,
messageText: string
}
type DialogsProps = {
dialogs: Array<DialogType>,
messages: Array<MessageType>,
sendMessage: (messageText: string) => void
}
Still don't fully understand the cause of the problem, but it's solved.