Hydrogel is a kind of 3D polymer network with strong swelling ability in water and appropriate mechanical and biological properties, which make it feasible to maintain bioactive substances and has promising applications in the fields of biomaterials, soft machines, and artificial tissues. Unfortunately, traditional hydrogels prepared by chemical crosslinking have poor mechanical properties and limited functions, which limit their further application. In recent years, with the continuous development of nanoparticle research, more and more studies have combined nanoparticles with hydrogels to make up for the shortcomings of traditional hydrogels. In this article, the types and functions of hydrogels and nanomaterials are introduced first, as well as the functions and applications of injectable nanocomposite hydrogels (INHs), then the latest progress of INHs for cancer treatment is reviewed, some existing problems are summarized, and the application prospect of NHs is prospected.