Because pronouns can be used as a substitute for people, places or things the writer uses this convention to refer the city as the feminine personal pronoun. The context of this section begins in Revelation 21:2 where John sees a vision of a city (feminine noun, πόλιν) coming down from heaven. I will trace some of the use of the convention from the verse you mentioned 21:21:
Revelation 21:21
21:22
Καὶ ναὸν οὐκ εἶδον ἐν αὐτῇ [...]
lit. I saw no temple in it
αὐτῇ is feminine, referring to the feminine noun city (translated literally as it)
From the context it is clear that it is referring to the city from 21:2. For what else in the text could a temple possibly absent from?
21:23
καὶ ἡ πόλις [...]
lit. And the city
πόλις (city) is feminine
Later in verse 23
[...] ἡ γὰρ δόξα τοῦ Θεοῦ ἐφώτισεν αὐτήν
lit. indeed the glory of God enlightened it
αὐτήν (it) is again feminine
Again continuing the convention of using the feminine pronoun to refer to the city
21:25
καὶ οἱ πυλῶνες αὐτῆς οὐ μὴ κλεισθῶσιν
lit. And the gates of it will not/never be shut
αὐτῆς (it = city) feminine
21:26
That continues through to 22:2. So unless I've missed something 21:23 is the last time before 22:2 that city is referred to as the feminine noun. The convention of the writer follows on consistently using the feminine pronoun to refer the feminine noun (city).
Many of the major English translations either translate it as city in 22:2, or leave it out (presumably because it is obvious that it is the street of the city)
NIV - down the middle of the great street of the city.
ESV - through the middle of the street of the city
NASB - in the middle of its street.
NLT - It flowed down the center of the main street.
So yes, αὐτῆς refers to the previously mentioned feminine noun (city).