Skip to content

Instantly share code, notes, and snippets.

@pk936
Created July 4, 2017 04:55
Show Gist options
  • Save pk936/39efeb8d153a82667e4207d0be736d0c to your computer and use it in GitHub Desktop.
Save pk936/39efeb8d153a82667e4207d0be736d0c to your computer and use it in GitHub Desktop.
Get updated props of the child implemented using ReactDOM.render.
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