I was reading Griffiths' Introduction to Electrodynamics, specifically Section 9.2.2 on plane waves. I can see that if we want a transverse wave traveling in the $z$ direction that we are only going to want our waves to have $x$ and $y$ components, but the reasoning in Griffiths left me confused.
We start with electric and magnetic field waves of the form \begin{align} E(z,t) & = E_{0}e^{i(kz-\omega t)} \\ B(z,t) & = B_{0}e^{i(kz-\omega t)} \end{align}
Since we are in free space, we have that $\nabla \cdot E = \nabla \cdot B = 0$.
Now comes the crucial step: Griffiths claims that these two facts immediately imply that
$$(E_{0})_{z} = (B_{0})_{z} = 0$$
I wasn't sure how this followed. I know that if I want my waves to be planar, that I need the x and y derivates of the fields to be 0, so that I have a constant magnitude over a front of constant phase, but I wasn't sure how to see that z derivative had to be zero as well. It seems that if you had an electric field plane wave whose real part was varying in space as a sine function, that if you were to look at its z derivative that you would get a cosine function.