このようなものはどこにも見たことがないので、これは一般的な質問です。したがって、以下の例のような親コンポーネントがあり、親で子の子をレンダリングする場合、可能な場合はどうすればよいでしょうか (親で getParentComponent(children) メソッドを作成する以外に)。子レンダーが呼び出されると、子コンテンツが自動的に挿入されるということはありましたか?
import React, {Component} from 'react';
import {View} from 'react--native;
class CustomView extends Component {
render() {
return (
<View style={styels.customStyle}>
// this is where I want to render my child content
</View>
)
}
}
import React, {Component} from 'react';
import {CustomView} from 'somewhere;
class ChildView extends CustomView {
render() {
return (
<View style={styels.childStyle}>
// take this view and all the content with in and render it in the parent render
</View>
)
}
}