Skip to content

ToolBar problem #136

@MP185496

Description

@MP185496

Description

Is there a way to add toolbars to our window?
I tried to add it in swift code, but i couldn't because i need view for that, and in our RTC screen we get back a window and window don't have toolbar option on it.

Is there a plan to add this from RN side or to make it work from swift side?
Thanks

Steps to reproduce

/

React Native Version

0.73.5

Affected Platforms

Runtime - Android, Runtime - iOS

Output of npx react-native info

/

Stacktrace or Logs

/

Reproducer

/

Screenshots and Videos

No response

Activity

okwasniewski

okwasniewski commented on Apr 5, 2024

@okwasniewski
Member

Hey, thanks for opening the issue. Once #137 will be merged and released you will be able to use toolbar modifier and ornaments on the Swift side, like so:

@main
struct RC07401VISIONOSApp: App {
  @UIApplicationDelegateAdaptor var delegate: AppDelegate
  
  var body: some Scene {
    WindowGroup {
      RCTRootViewRepresentable(moduleName: "RC07401VISIONOS", initialProps: nil)
        .modifier(WindowHandlingModifier())
        // Add ornaments 
    }
  }
}
MP185496

MP185496 commented on Apr 5, 2024

@MP185496
Author

Hey, thanks for opening the issue. Once #137 will be merged and released you will be able to use toolbar modifier and ornaments on the Swift side, like so:

@main
struct RC07401VISIONOSApp: App {
  @UIApplicationDelegateAdaptor var delegate: AppDelegate
  
  var body: some Scene {
    WindowGroup {
      RCTRootViewRepresentable(moduleName: "RC07401VISIONOS", initialProps: nil)
        .modifier(WindowHandlingModifier())
        // Add ornaments 
    }
  }
}

Awsome, thank you very much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @okwasniewski@MP185496

      Issue actions

        ToolBar problem · Issue #136 · callstack/react-native-visionos