Check out example codes for "how to dismiss keyboard swiftui". It will help you in understanding the concepts better.

Code Example 1

#if canImport(UIKit)
extension View {
    func hideKeyboard() {
        UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
    }
}
#endif

Learn ReactJs, React Native from akashmittal.com