react-native-macos
react-native-macos copied to clipboard
Support for multiple NSWindow instances or additionals windows
First approach: multiple windows components.
<App>
<Window main />
<Window />
</App>
Second approach: additional windows as a components
React.registerWindow(window1)
The another way to achieve that: stand-alone instances of RCTRootView, RCTBridge for each Window. Need to way to communicate between windows.
This now have partial support with <Modal />
component. See https://github.com/ptmt/react-native-desktop/blob/master/Examples/UIExplorer/ModalExample.js
The first option strikes me as a particularly nice React-like way to manage windows
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
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?