App Store Review Request error Swift 6

I'm fairly new to Swift, so I'm unsure as to what's going wrong with my code and how to fix it.

After switching to Swift 6, the view I have with requestReview throws: "Cannot form key path to main actor-isolated property 'requestReview'"

As I understand it, this is potentially due to the changes made to @MainActor. However, I am unsure how to go about fixing this error.

We are also unsure how to go about fixing this error because you haven't given us any code.

This is my first post and I was unsure of what was needed exactly.

Here is my code:

import StoreKit
import SwiftData
import SwiftUI

struct AddItemView: View {
    @Environment(\.requestReview) var requestReview`

var body: some View {
        NavigationStack {
            VStack {
                Form {
                   ...
                }
            }
        }
    }
    
    @MainActor 
    func showReview() {
        itemsCreated += 1
        
        if itemsCreated == 10 {
            requestReview()
        }
    }
}

If anything else is needed, please let me know and I will do my best to include it.

App Store Review Request error Swift 6
 
 
Q