{"id":13474812,"url":"https://github.com/vitalybe/ReactNativeUniversal","last_synced_at":"2025-03-26T22:31:16.819Z","repository":{"id":147279399,"uuid":"89351341","full_name":"vitalybe/ReactNativeUniversal","owner":"vitalybe","description":"A demonstration of sharing javascript react-native code between mobile, desktop and web environments","archived":false,"fork":false,"pushed_at":"2017-09-09T20:27:40.000Z","size":2185,"stargazers_count":177,"open_issues_count":0,"forks_count":14,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-30T08:50:41.283Z","etag":null,"topics":["boilerplate","electron","react-native","react-native-web","sample"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vitalybe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-25T11:08:48.000Z","updated_at":"2023-12-20T05:52:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"cafcd2d0-cbb5-4223-9382-262403a9c67d","html_url":"https://github.com/vitalybe/ReactNativeUniversal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitalybe%2FReactNativeUniversal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitalybe%2FReactNativeUniversal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitalybe%2FReactNativeUniversal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vitalybe%2FReactNativeUniversal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vitalybe","download_url":"https://codeload.github.com/vitalybe/ReactNativeUniversal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245747660,"owners_count":20665835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["boilerplate","electron","react-native","react-native-web","sample"],"created_at":"2024-07-31T16:01:14.984Z","updated_at":"2025-03-26T22:31:16.813Z","avatar_url":"https://github.com/vitalybe.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"Universal React - Android, Electron (Desktop) and Web\n=====================================================\n\nElectron             |  Web |\n|:-------------------------:|:-------------------------:|\n![](images/electron.gif) | ![](images/web.gif)\n\nAndroid                       | iOS\n|:-------------------------:|:---------:|\n![](images/android.gif) | ![](images/ios.gif)\n\n\nAbout\n-----\n\nThis sample demonstrates the usage of React Native in in the **desktop, web and mobile** environment **using the same code**.\n\nComponents or services that should differ between the platforms are easy to to include using a predefined suffix.\n\nWhat's included\n---------------\n\nThe following features are included and demonstrated:\n\n* Using shared components (e.g using `Ball.js` in [BallsList.js](app/BallsList.js))\n* Using platform specific components (e.g using `PlatformSpecificBall.js` in [BallsList.js](app/BallsList.js))\n* Packaging production build for Web and Electron (for Android follow the [official guide](https://facebook.github.io/react-native/docs/signed-apk-android.html))\n* React Native's ListView\n* React Native's Animations\n\n\nRunning\n-------\nThe following commands are available:\n\n* `yarn run web` - Web development\n* `yarn run web-build` - Web production package\n* `yarn run desktop` - Electron development\n* `yarn run desktop-build` - Electron production package\n* `yarn run android` - Android development\n\n\n\nStructure\n---------\n\n**Platform specific components**\n\nBy default all the javascript files are shared by all the platforms. To create a platform specific file, suffix it accordingly.\n\nFor example if you have a generic `Ball.js` file and would like Electron to have its own platform specific version, we'd create a new file `Ball.electron.js`.\n\nThe file will be imported everywhere without extension: `import Ball from './Ball`. All the platforms will import the generic file and only Electron will import its own platform file.\n\nThis mechanism is achieved by Webpack's [extension resolution](https://webpack.js.org/configuration/resolve/#resolve-extensions).\n\n**Web and Electron**\n\nPowered by the [react-native-web](https://github.com/necolas/react-native-web) project.\n\nWebpack configuration (in [webpack/config](webpack/config)) are based on the scripts of [create-react-app](https://github.com/facebookincubator/create-react-app) with only minor changes that allows it to be updated by future changes.\n\n\nWhat's missing\n--------------\n\nMissing features:\n\n* Test\n\n\nLicense\n-------\n\nThis project is [MIT licensed](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitalybe%2FReactNativeUniversal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvitalybe%2FReactNativeUniversal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvitalybe%2FReactNativeUniversal/lists"}