Throughout the letter the writer uses repetition and contrast between opposites. For example:
This is the message we have heard from him and proclaim to you, that God is light, and in him is no darkness at all. (1:5) 1
Therefore the phrase “God is love” leads one to expect to find it placed in conjunction with its opposite: “God is love, in whom there is no hate at all.” Yet hate is missing from the phrase and raises the question: "Is John saying that God does not hate?"
I do not believe that is John's message. Rather the absence of hate is that he does not see love and hate as opposites.
“God is love” is repeated:
Anyone who does not love does not know God, because God is love. (4:8)
So we have come to know and to believe the love that God has for us. God is love, and whoever abides in love abides in God, and God abides in him. (4:16)
In this case the repetition allows comparison of the contrasting elements:
4:8: Anyone who does not love/God is love
4:16: God has love for us/God is love
Throughout the letter the writer encourages the reader to love. He is to love his brother (2:10, 3:10, 4:20, 4:21) and to love one another (3:11, 3:23, 4:7, 4:11, 4:12) and to love God (5:2). So in the case of the first “God is love” the corresponding partner is given in positive terms in the preceding verse:
Beloved, let us love one another, for love is from God, and whoever loves has been born of God and knows God. (4:7)
4:7-8: Love one another + anyone who does not love/God is love
The first God is love is paired with both a positive and a negative element.
Also in contrast with light and dark, God is placed second and the sequence is inverted. The reader can rearrange the verses to place “God is love” as the primary condition:
4:16: God is love/God has love for us
4:7-8: God is love/love one another and failure to love means one does not know God
The writer’s point is that the opposite of love is a failure to love.
In addition, the writer defines love as an action:
By this we know love, that he laid down his life for us, and we ought to lay down our lives for the brothers. (3:17)
Little children, let us not love in word or talk but in deed and in truth. (3:18)
For God so loved the world, that he gave his only Son, that whoever believes in him should not perish but have eternal life. (John 3:16)
If love is an action then:
4:16: God is love/God has love for us and will not fail to show His love
4:7-8: God is love/love one another and failure to show love means one does not know God
In essence the writer has said love is an action directed toward others. So since God’s nature is love, He will always show His love. Or put in terms of opposites like light and dark:
God is love in whom there is no failure to demonstrate His love.
As for hate:
“I have loved you,” says the LORD. But you say, “How have you loved us?” “Is not Esau Jacob's brother?” declares the LORD. “Yet I have loved Jacob but Esau I have hated... (Malachi 1:2-3)
Whatever meaning or significance one derives from "Esau I have hated," has no bearing on God's love. Hatred is not a limiting element or restriction on God's love. Hatred did not stop God from sending Jesus. Hatred did not stop Jesus from laying His life down for all, including Esau.
1. English Standard Version