react-native-macos icon indicating copy to clipboard operation
react-native-macos copied to clipboard

Support for multiple NSWindow instances or additionals windows

Open ptmt opened this issue 9 years ago • 5 comments

First approach: multiple windows components.

<App>
  <Window main />
  <Window />
</App>

Second approach: additional windows as a components

React.registerWindow(window1)

ptmt avatar Feb 06 '16 17:02 ptmt

The another way to achieve that: stand-alone instances of RCTRootView, RCTBridge for each Window. Need to way to communicate between windows.

ptmt avatar Mar 03 '16 09:03 ptmt

This now have partial support with <Modal /> component. See https://github.com/ptmt/react-native-desktop/blob/master/Examples/UIExplorer/ModalExample.js

ptmt avatar Jun 18 '16 10:06 ptmt

The first option strikes me as a particularly nice React-like way to manage windows

tommoor avatar Jun 26 '16 02:06 tommoor

Copied from https://github.com/ptmt/react-native-macos/issues/70#issuecomment-471194915:

I wrote down some thoughts on the potential API for this: https://gist.github.com/aleclarson/1eb38f8a1560a910692b624325d38767

We could also take inspiration from Electron: https://electronjs.org/docs/api/browser-window

aleclarson avatar Mar 25 '19 13:03 aleclarson

Copied from https://github.com/ptmt/react-native-macos/issues/70#issuecomment-471305598:

I think this is a good starting point. I’m curious what it would like in React Native itself if Apple introduced window support for iOS in June at next WWDC. Would it be enough for most use cases (e.g. tabbed support, NSDocument, or some other edge cases). Maybe we can try to implement some subset, at least extracting the current hardcoded single window support from the core?

aleclarson avatar Mar 25 '19 13:03 aleclarson