In shafarevich's book "Basic algebraic geometry", there is an intersection dimension theorem as follows:
Let $V$, $W$ be any two irreducible closed subvarieties of $\mathbb{A}^n$ (the affine space over an algebraic closed field $k$), if $V\cap W\neq \emptyset$ , then each irreducible component of $V\cap W$ has dimension at least $\dim(V)+\dim(W)-n$.
My question is if we replace $\mathbb{A}^n$ by any smooth variety, is the statement still true? Is there any reference?
PS: I know a counterexample if $\mathbb{A}^n$ is replaced by singular variety.