npx react-native init DesktopSampleApp --version 0.60.6
cd DesktopSampleApp
npx https://github.com/status-im/react-native-desktop-qt-init.git
This command will add react-native-desktop-qt
package to your project and generate desktop
folder with desktop project files.
Unless you have local chagnes, answer 'y' when shell prompts you to replace babel.config.js
If you're using macOS, run these commands in 2 different shells (from DesktopSampleApp
dir):
npm start #starts bundler
node node_modules/react-native-desktop-qt/js-executor.js #starts js server
Afterwards, in a 3rd shell execute:
npx react-native run-desktop
Compilation of desktop project will start. Then it will run:
Note: On non-macOS systems, npm start
and node js-executor.js
will be executed automatically by the above command(react-native run-desktop
)
If you want to know why you had to start bundler and js server - check the doc on how react-native-desktop works internally