The effect of an intervention in a stepped wedge design can vary across clusters or with time since exposure to treatment, but consequences of such heterogeneous treatment effects for the analysis of stepped wedge designs are not well recognized. In this article, we advance the idea that the stepped wedge design can be framed as a special case of a difference-in-differences design with staggered treatment exposure. Using this perspective, we show that the standard difference-in-differences regression approach estimates the average treatment effect of the treatment period with bias when treatment effects vary by cluster or time since exposure. We then use Monte-Carlo simulations of stepped wedge designs to examine the performance of the standard regression approach as well as alternative approaches that estimate treatment effects relative to intervention exposure. Simulation results confirm that estimates from the standard approach are biased when treatment effects are heterogeneous. Alternative regression approaches may perform better, but only if the research design allows estimation of the full treatment effect across all clusters. We conclude by offering recommendations for the design and analysis of stepped wedge trials.