callstack / react-native-visionos

A framework for building native visionOS applications using React
https://callstack.github.io/react-native-visionos-docs/
MIT License
977 stars 28 forks source link

feat: allow to use WindowHandlingModifier outside of RCTMainWindow #137

Closed okwasniewski closed 6 months ago

okwasniewski commented 6 months ago

Summary:

This PR exposes WindowHandlingModifier in order to allow users to ditch RCTMainWindow and use custom setup (for example when they want to add ornaments on main window).

@main
struct RC07401VISIONOSApp: App {
  @UIApplicationDelegateAdaptor var delegate: AppDelegate

  var body: some Scene {
    WindowGroup {
      RCTRootViewRepresentable(moduleName: "RC07401VISIONOS", initialProps: nil)
        .modifier(WindowHandlingModifier())
        // Add ornaments 
    }
  }
}

Resolves #136

Changelog:

[VISIONOS] [ADDED] - Expose WindowHandlingModifier

Test Plan:

CI Green