Exploiting the lability of metal halide perovskites for doping semiconductor nanocomposites