/**
* @jsx React.DOM
*/
var Dummy = React.createClass({
mixins: [React.addons.LinkedStateMixin],
getInitialState: function() {
return [42, 54];
},
render: function() {
return <div>
{this.state.map(this.renderItem)}
<pre>{JSON.stringify(this.state, null, 2)}</pre>
</div>
},
renderItem: function(item, i) {
return <div>
<input type="number" valueLink={this.linkState(i)}/>
</div>
}
});
React.renderComponent(
<Dummy/>,
document.body
);
When I’m changing numbers in the input fields React throws:
Uncaught Error: Invariant Violation: Critical assumptions about the merge functions have been violated. This is the fault of the merge functions themselves, not necessarily the callers.
Is it a bug in React? Is merging arrays not working?