Passing events from SwiftUI Button created by RN and getting it back to SwiftUI
This commit is contained in:
parent
41081b5084
commit
1a9884e0e9
6 changed files with 24 additions and 14 deletions
|
@ -15,6 +15,9 @@ final class SharedState: ObservableObject {
|
|||
var reactNativeFactory: RCTReactNativeFactory?
|
||||
private let emitter = EventEmitter.sharedInstance
|
||||
|
||||
// SwiftUI => RN => SwiftUI
|
||||
@Published var text1: String = ""
|
||||
|
||||
func send(message: String) {
|
||||
emitter.send(message: message)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue