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
|
@ -11,12 +11,14 @@ struct ToolboxHeader: View {
|
|||
@EnvironmentObject var sharedState: SharedState
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
Text("Actions")
|
||||
Button("Make it blue") {
|
||||
print("Making it blue")
|
||||
sharedState.send(message: "hello from Swift!")
|
||||
VStack {
|
||||
HStack {
|
||||
Text("Actions")
|
||||
Button("Make it blue") {
|
||||
sharedState.send(message: "hello from Swift!")
|
||||
}
|
||||
}
|
||||
Text("SwiftUI => RN => SwiftUI: \(sharedState.text1)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue