I have a backdraftjs component that displays a message. When you click it I want it to go away. How should I make it go away?
class QuickMessage extends Component {
bdElements() {
return e.div(
{className: 'quick_message', bdAdvise: {click: 'dismissMe'}},
this.kwargs.message
);
}
dismissMe() {
// what should go here ? should it just remove the dom element or
// will that leave code hanging around?
}
}
method that displays the error inside #someDomId:
reportError = (errmsg) => render(QuickMessage, {message: errmsg}, "someDomId");
You should call
destroy
:The documentation says:
This is the most you can expect to happen in terms of cleanup. The next time you call
reportError
a new instance of your component will be created.