The thermal expansion behaviour of single crystals of intermetallic compounds Y2(Fe1 - xCox)14B (x = 0, 0.1, 0.2, 0.3) was studied in the temperature range 5-1000 K. The Invar-type anomaly in the temperature dependence of the lattice parameter a disappears and the spontaneous volume magnetostriction ωs decreases with increasing x. The temperature and composition dependences of the spontaneous linear and volume magnetostrictions are discussed in terms of the temperature and composition dependences of the spontaneous magnetic moment.