If you know as a fact that God is righteous, John says, then you will perceive as a logical consequence *that everyone who does what is right has been born of him* (1 Jn. 2:29). The child exhibits the parent's character because he shares the parent's nature. A person's righteousness is thus the evidence of his new birth, not the cause or condition of it.
From "The Letters of John" (Tyndale New Testament Commentaries: rev. edn. Leicester: IVP, 1988), p. 122