javascript - React.js Updating UI after removing a row form a list -
i'm new react, i'm have react component generates list. list has delete button generated it, bound event handler. when button clicked pass in id of row removed , removed it. part i'm struggling how update list once row has been removed it?
whats best practice react way of doing ? have created fiddle, sadly it's not rendering list.
thanks help
var clickhandler = function(ev){ var idx = ev.dispatchmarker.split('$')[1]; data.splice( idx, 1 ); ///remove row //how update ui? };
like said in comments, use state
instead of props
.
but direct answer question use: this.forceupdate();
Comments
Post a Comment