Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const t = <SomeOtherComponent someProp="test" />;
  2. class MyComponent extends React.Component {
  3.     render() {
  4.         return t;
  5.     }
  6. }
  7. // Assume SomeOtherComponent is in a different file.
  8. class SomeOtherComponent extends React.Component {
  9.     constructor(props) {
  10.         super(props);
  11.         console.log("NEW!!");  
  12.     }
  13.     render() {
  14.         return this.props.someProp;
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement