Skip to content

Instantly share code, notes, and snippets.

@joecritch joecritch/gist:476806f0174ed74791ec Secret
Last active Aug 29, 2015

Embed
What would you like to do?
using React.addons.update + splice to replace array elements by key
var points = React.addons.update(this.state.points, {
$splice: [
[
this.state.myIndex,
1,
{
latLng: latLng,
place: true,
title: title
}
]
]
})
@joecritch

This comment has been minimized.

Copy link
Owner Author

commented Jun 30, 2014

This would create a new array, with a replaced object, positioned at whatever this.state.myIndex is equal to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.