ためProptypeが、私はこのproptypeを定義する必要がありますどのようにwindow.document
HTMLDocumentの
<MyComponent container={document} />
を受け入れ小道具を持っていますか?
MyComponent.propTypes = {
container: Proptypes.????.isRequired
};
ためProptypeが、私はこのproptypeを定義する必要がありますどのようにwindow.document
HTMLDocumentの
<MyComponent container={document} />
を受け入れ小道具を持っていますか?
MyComponent.propTypes = {
container: Proptypes.????.isRequired
};
Ah! instanceOf
を使用して、次の作品...
container: PropTypes.instanceOf(HTMLDocument).isRequired
更新
は 'HTMLDocumentの' IE10では動作しません。あなたはIE10をサポートする必要がある場合
あなたが述べたようhere
PropTypes.instanceOf(Document)
を使用することができ、抽象インタフェースHTMLDocumentはDocumentインタフェースを拡張します。
'PropTypes.node'を試しましたか? –
@FabianSchultz:うん。うまくいかなかった – sfletche
それは要素ですか? (最高の教育を受けた推測)が、おそらく? –
@promisified:試しました。サイコロはありません:( – sfletche