Created
July 4, 2017 04:55
-
-
Save pk936/39efeb8d153a82667e4207d0be736d0c to your computer and use it in GitHub Desktop.
Get updated props of the child implemented using ReactDOM.render.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Parent extends React.Component{ | |
constructor(props){ | |
super(props) | |
} | |
open(){ | |
let _this = this; | |
var _html = '<div class="collapsible-body" id="'+eleId+'"></div>'; | |
taskdetail = ReactDOM.render(<TaskDetail data={_this.props.data}/>, document.getElementById(eleId)); // Child "TaskDetail" does not get updated props. | |
$(`.collapsible-header`).parent().append(_html); | |
} | |
render(){ | |
return ( | |
<button onClick={()=>this.open()}> Clikc me </button> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment