1 John, Chapter 3, Verses 7-10 agrees with what is written in James.
7 Dear children, do not let anyone lead you astray. The one who does what is right is righteous, just as he is righteous. 8 The one who does what is sinful is of the devil, because the devil has been sinning from the beginning. The reason the Son of God appeared was to destroy the devil’s work. 9 No one who is born of God will continue to sin, because God’s seed remains in them; they cannot go on sinning, because they have been born of God. 10 This is how we know who the children of God are and who the children of the devil are: Anyone who does not do what is right is not God’s child, nor is anyone who does not love their brother and sister.