how to change use of old gameObject.active to new style

i have the following code which works but throws a little yellow warning due to active being obsolete…my question is how would i go about changing this code to use the new functionality?

static function CopyTransformsRecurse (src: Transform, dst: Transform) {
  dst.position = src.position;
  dst.rotation = src.rotation;
  dst.gameObject.active = src.gameObject.active;
  for (var child: Transform in dst) {
    // match the transform with the same name
    var curSrc = src.Find(child.name);
    if (curSrc) CopyTransformsRecurse(curSrc, child);
  }
}

the above function is called in the following piece of code…

if (hit.collider.gameObject.CompareTag("Target")){ // if collided with the right object...
   				 // create replacement at same position and with same rotation:
    			var dead: Transform = Instantiate(replacement, transform.position, transform.rotation);
   				 // copy position and rotation to the children recursively:
   				CopyTransformsRecurse(hit.collider.gameObject.transform, dead);
    			// destroy the original object:
   				Destroy(hit.collider.gameObject);
  				}

thanks for any help

.active is obsolete, use .SetActive(state) instead.

To read state use .activeSelf.

dst.gameObject.SetActive(src.gameObject.activeSelf);