Currently I have a class component that contains functions that act as components in my JSX.
Example:
class MyComponent extends React.Component {
MySubComponent = (props) => {
if (props.display) {
return <p>This text is displayed</p>
}
}
render() {
return (
<this.MySubComponent display={true} />
)
}
}
Are there any repercussions to calling components this way? Also is there a term for this?