All Projects → PaulLeCam → React Native Electron

PaulLeCam / React Native Electron

Licence: mit
Electron extensions to React Native for Web

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Electron

Avogadrolibs
Avogadro libraries provide 3D rendering, visualization, analysis and data processing useful in computational chemistry, molecular modeling, bioinformatics, materials science, and related areas.
Stars: ✭ 164 (-14.14%)
Mutual labels:  desktop
Komorebi
A beautiful and customizable wallpapers manager for Linux
Stars: ✭ 2,472 (+1194.24%)
Mutual labels:  desktop
Reactotron
A desktop app for inspecting your React JS and React Native projects. macOS, Linux, and Windows.
Stars: ✭ 13,337 (+6882.72%)
Mutual labels:  desktop
Frameless Titlebar
Customizable Electron Titlebar for frameless windows
Stars: ✭ 167 (-12.57%)
Mutual labels:  desktop
Mota
🎡 A state management library
Stars: ✭ 177 (-7.33%)
Mutual labels:  desktop
Xiaomiadbfastboottools
A simple tool for managing Xiaomi devices on desktop using ADB and Fastboot
Stars: ✭ 2,810 (+1371.2%)
Mutual labels:  desktop
Preact Photon
🚀 Beautiful desktop apps with Preact + Photon ❤️
Stars: ✭ 158 (-17.28%)
Mutual labels:  desktop
Glimmer
DSL Framework consisting of a DSL Engine and a Data-Binding Library used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI), Glimmer DSL for XML (& HTML), Glimmer DSL for CSS, and Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
Stars: ✭ 186 (-2.62%)
Mutual labels:  desktop
Robot
Native cross-platform system automation
Stars: ✭ 178 (-6.81%)
Mutual labels:  desktop
Flutter Webrtc
WebRTC plugin for Flutter Mobile/Desktop/Web
Stars: ✭ 2,764 (+1347.12%)
Mutual labels:  desktop
Oh My Earth
Make a real time earth picture as your wallpaper
Stars: ✭ 168 (-12.04%)
Mutual labels:  desktop
Desktopfolder
Bring your Desktop Back to Life
Stars: ✭ 171 (-10.47%)
Mutual labels:  desktop
Phantomstyle
Cross-platform QStyle for traditionalists
Stars: ✭ 179 (-6.28%)
Mutual labels:  desktop
Muon
GPU based Electron on a diet
Stars: ✭ 2,068 (+982.72%)
Mutual labels:  desktop
Saladict Desktop
✨✨桌面划词与翻译工具,聚合了 N 多词典,功能强大,支持 Windows 、 Mac 和 Linux。
Stars: ✭ 187 (-2.09%)
Mutual labels:  desktop
Freelook
Freelook, an Electron-based client for Microsoft Outlook.
Stars: ✭ 159 (-16.75%)
Mutual labels:  desktop
Wmail
The missing desktop client for Gmail & Google Inbox
Stars: ✭ 2,093 (+995.81%)
Mutual labels:  desktop
Messenger For Desktop
This is not an official Facebook product, and is not affiliated with, or sponsored or endorsed by, Facebook.
Stars: ✭ 2,180 (+1041.36%)
Mutual labels:  desktop
Youi
Next generation user interface and application development in Scala and Scala.js for web, mobile, and desktop.
Stars: ✭ 186 (-2.62%)
Mutual labels:  desktop
Ansible
Ansible playbooks for managing an elementary school IT infrastructure (mostly Windows desktops)
Stars: ✭ 181 (-5.24%)
Mutual labels:  desktop

React Native Electron Build Status npm version

Electron extensions to React Native for Web

Introduction

This project aims to provide extensions to React Native for Web targeted to the Electron environment to support additional modules exposed by React Native (Alert) or alternative implementations (Linking) using Electron APIs.

Installation

npm install react-native-electron

electron, react and react-native-web are required peer dependencies, make sure to install them as well:

npm install electron react react-native-web

react-art is also needed if you use ART.

Electron setup

In order for the APIs exposed by react-native-electron to be accessible in Electron's render process, the following setup must be applied:

  • The react-native-electron/main module must be imported in the main process
  • BrowserWindow instances must be created with the following webPreferences options:
webPreferences: {
  contextIsolation: false,
  preload: require('path').resolve(
    require.resolve('react-native-electron/preload'),
  ),
},

Example

See the example directory for the source code and Webpack config.

To run the demo app, fork this repository and run the following commands in the root folder:

  • npm install
  • npm run build

Then in the example folder:

  • npm install
  • npm start

Usage with Expo application

This module can be used with Expo application (created by expo-cli) using the following steps:

  • Follow this guide's setup
  • Run yarn expo-electron customize in order to eject expo-electron's webpack configuration
  • Edit ./electron/webpack.config.js as follows:
const { withExpoWebpack } = require('@expo/electron-adapter')

module.exports = (config) => {
  const expoConfig = withExpoWebpack(config)
  expoConfig.resolve.alias['react-native$'] = 'react-native-electron'
  return expoConfig
}

Note this is a partial solution, as Expo's default webpack configuration includes more aliases to react-native, but it should cover all of react-native-electron's APIs.

APIs

Alert

React Native's Alert implementation using Electron's dialog

Alert.alert(
  title: string,
  message: ?string,
  buttons: ?Array<{text: string, onPress?: () => void}> = [],
  type: ?('none' | 'info' | 'error' | 'question' | 'warning') = 'none'
): void

Linking

React Native's Linking implementation using Electron's app and shell APIs.

Linking.openURL(url: string): Promise<void>

Linking.addEventListener(type: string, handler: Function): void

Linking.removeEventListener(type: string, handler: Function): void

Linking.canOpenURL(): Promise<true>: always resolves to true

Linking.getInitialURL(): Promise<?string>: resolves with the process.argv[1] value, expecting the app to be opened by a command such as myapp myapp://test

License

MIT
See LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].