Open tido64 opened 4 years ago
We will likely migrate to SwiftUI and deprecate Main.storyboard
entirely. This will require us to bump the macOS deployment target to 11.0+. At the moment, we're stuck on 10.15 so we're looking at 4.0 release at the earliest.
In any case, I did some preliminary investigation and it looks like we no longer need to declare the default menu items. The code below will correctly insert the React menu between View and Window:
import SwiftUI
@main
struct ReactTestApp: App {
@State private var rememberLastComponent = false
var body: some Scene {
WindowGroup {
ContentView()
}
.commands {
CommandMenu(LocalizedStringKey(stringLiteral: "React")) {
Button(LocalizedStringKey(stringLiteral: "Load Embedded JS Bundle")) {
// TODO
}
Button(LocalizedStringKey(stringLiteral: "Load From Dev Server")) {
// TODO
}
Toggle(LocalizedStringKey(stringLiteral: "Remember Last Opened Component"), isOn: $rememberLastComponent)
Divider()
}
}
}
}
Originally posted by @alloy in https://github.com/microsoft/react-native-test-app/pull/104