135
rated 0 times
[
142]
[
7]
/ answers: 1 / hits: 27629
/ 9 Years ago, tue, july 14, 2015, 12:00:00
This is my piece of code, which works correctly (adds records), but throws an error after addition:
Uncaught Error: Invariant Violation: enqueueCallback(...): You called
setProps
,replaceProps
,setState
,replaceState
, or
forceUpdate
with a callback that isn't callable.
handleSubmit: function(e) {
e.preventDefault();
return $.post('', {page: this.state},
function(data) {
this.props.handleNewPage(data);
return this.setState(this.getInitialState(), 'JSON');
}.bind(this)
);
}
There are no routes for now. Can someone help me to solve this?
More From » reactjs