Controlling heat flow is a major challenge for many technologies. In electronic and photonic devices, for example, heat dissipation can limit the performance and efficiency, as well as their potential for further miniaturization. At the same time, two-dimensional (2D) materials, which are made of layers just a few atoms thick, have emerged as a promising platform in these fields. For example, 2D semiconductors are expected to be used in conduction channels of future transistors. However, their thermal behavior remains difficult to predict and control.