Replaces child with given index with new child.
Replaces first instance of given child with new child.