Consider the Cauchy theorem:
Let $D\subset \mathbb C$ be a domain such that $\partial D$ is smooth and $\overline{D}$ is compact. Let $f$ be holomorphic on $D$ and continuous on the closure. Then $$\int_{\partial D}f(z) dz = 0$$.
Is this a valid proof?
Use Stokes' theorem as follows:
$$ \int_{\partial D}f(z) dz = \int_D d(f(z) dz) = \int_D g(z) ddz = 0$$ since $ddz = 0$. Here $g(z)$ is some smooth map that is equal to $df(z)$.
As mollyerin says, you need to be more careful. I would use the following argument.
Let $u,v:D\to\mathbb{R}$ be the real and imaginary parts of $f$, and let $x,y,$ be real coordinates on $D$. We have $$f(z)dz=(u(z)+iv(z))(dx+idy)=u(z)dx-v(z)dy+i(u(z)dy+v(z)dx).$$Since $f$ is holomorphic, the Cauchy-Riemann equations imply that both real and imaginary part of the above $1$-form are closed. By Stokes' theorem, the integral of a closed form on a boundary vanishes. The theorem follows.