クラスコンポーネントで複数の静的ContextTypeを定義するには?クラスコンポーネントで複数の静的ContextTypeを定義するには?

1109 ワード

クラスコンポーネントで複数の静的ContextTypeを定義するには?


9月28日
コメント: 1
回答:0
0

こんにちは私はクラスコンポーネントメソッドで複数のコンテキストを使用する必要があるときにどのように複数の静的contexttypeを定義できるかを知りたいです.
export default class Component extends React.Component{
static contextType = MyContext1; //and MyContext2

constructor(props){
    super(props);
}

componentDidMount = () => console.log(this.context); //need Context2

render(){
    return(
...
Open Full Question