2
Reactコンポーネントに多相を使用しようとしていますが、「このタイプはVの互換性のないインスタンス化と互換性がありません」というエラーが表示されています。フロータイプの多型が機能しない
// @flow
import React, { Component } from 'react'
type BaseProps = {
name: string
}
type BaseState<T> = {
error: string,
value: ?T,
}
class Base<Props, V> extends Component<any, BaseProps & Props, BaseState<V>> {
state = {
error: '',
value: null,
}
render() {
return <div>this.props.name</div>
}
}
type ExtendedProps = {
foo: string,
}
class ExtendedBase extends Base<ExtendedProps, string> {
render() {
return <div>this.props.name</div>
}
}
はコードです。
私は間違っていますか?