All Projects → avishayil → React Native Restart

avishayil / React Native Restart

Licence: mit
React Native Package With One Purpose: To Restart Your React Native Project

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to React Native Restart

Exporter
Lightweight Exporter library
Stars: ✭ 384 (-36.42%)
Mutual labels:  bundle
Tooling
Modular JavaScript Tooling.
Stars: ✭ 421 (-30.3%)
Mutual labels:  bundle
Whybundled
Answers the question – Why the hell is this module in a bundle?
Stars: ✭ 477 (-21.03%)
Mutual labels:  bundle
Doctrinebundle
Symfony Bundle for Doctrine ORM and DBAL
Stars: ✭ 4,225 (+599.5%)
Mutual labels:  bundle
Sonatamediabundle
Symfony SonataMediaBundle
Stars: ✭ 415 (-31.29%)
Mutual labels:  bundle
Phone Number Bundle
Integrates libphonenumber into your Symfony2-Symfony4 application
Stars: ✭ 446 (-26.16%)
Mutual labels:  bundle
Homebrew Bundle
📦 Bundler for non-Ruby dependencies from Homebrew, Homebrew Cask and the Mac App Store.
Stars: ✭ 3,940 (+552.32%)
Mutual labels:  bundle
Entityauditbundle
Audit for Doctrine Entities
Stars: ✭ 546 (-9.6%)
Mutual labels:  bundle
Debundle
🗃 A javascript debundler. Takes a Browserify or Webpack bundle and recreates the initial, pre-bundled source.
Stars: ✭ 420 (-30.46%)
Mutual labels:  bundle
Foscommentbundle
Threaded comments for Symfony
Stars: ✭ 451 (-25.33%)
Mutual labels:  bundle
Rollup Plugin Visualizer
📈⚖️ Visuallize your bundle
Stars: ✭ 405 (-32.95%)
Mutual labels:  bundle
Doctrineenumbundle
📦 Provides support of ENUM type for Doctrine in Symfony applications.
Stars: ✭ 410 (-32.12%)
Mutual labels:  bundle
Liipmonitorbundle
Integrates the LiipMonitor library into Symfony
Stars: ✭ 445 (-26.32%)
Mutual labels:  bundle
Sonatadoctrineormadminbundle
Integrate Doctrine ORM into the SonataAdminBundle
Stars: ✭ 400 (-33.77%)
Mutual labels:  bundle
Sensiodistributionbundle
Base bundle for Symfony Distributions
Stars: ✭ 501 (-17.05%)
Mutual labels:  bundle
Assetic Bundle
[DEPRECATED] This was the recommended way to manage web assets in Symfony 2 applications. Newer Symfony applications should use Webpack Encore.
Stars: ✭ 370 (-38.74%)
Mutual labels:  bundle
Jwtrefreshtokenbundle
Implements a Refresh Token system over Json Web Tokens in Symfony
Stars: ✭ 425 (-29.64%)
Mutual labels:  bundle
Poi
⚡A zero-config bundler for JavaScript applications.
Stars: ✭ 5,291 (+775.99%)
Mutual labels:  bundle
Sentry Symfony
The official Symfony SDK for Sentry (sentry.io)
Stars: ✭ 515 (-14.74%)
Mutual labels:  bundle
Easy Deploy Bundle
The easiest way to deploy your Symfony applications
Stars: ✭ 446 (-26.16%)
Mutual labels:  bundle

React Native Restart

npm version npm downloads Build Status

Sometimes you want to reload your app bundle during app runtime. This package will allow you to do it.

iOS GIF Android GIF

Installation

With yarn

$ yarn add react-native-restart

With npm

$ npm install --save react-native-restart

Auto-Linking Setup (react-native >= 0.60)

iOS

$ cd ios
$ pod install

Android

No further steps should be taken

Automatic Installation (Without Auto-Linking)

react-native link react-native-restart or npm install -g rnpm && rnpm link react-native-restart

Manual Android Installation

In android/settings.gradle

...

include ':react-native-restart'
project(':react-native-restart').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-restart/android')

In android/app/build.gradle

...

dependencies {
    ...

    implementation project(':react-native-restart')
}

Register module (in MainApplication.java)

import com.reactnativerestart.RestartPackage;  // <--- Import

public class MainApplication extends Application implements ReactApplication {

	private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
  		......

	      /**
	     * A list of packages used by the app. If the app uses additional views
	     * or modules besides the default ones, add more packages here.
	     */
	    @Override
	    protected List<ReactPackage> getPackages() {
	        ...
	        return Arrays.<ReactPackage>asList(
	                new MainReactPackage(),
	                new RestartPackage() // Add this line
	        );
	    }
	};
	......
};

Manual iOS Installation

Importing The Library

  • Drag the file Restart.xcodeproj from /node_modules/react-native-restart/ios into the Libraries group in the Project navigator. Ensure that Copy items if needed is UNCHECKED!

Add Files To...

Library Imported Successfully

  • Ensure that libRestart.a is linked through Link Binary With Libraries on Build Phases:

Library Linked

  • Ensure that Header Search Paths on Build Settings has the path $(SRCROOT)/../node_modules/react-native-restart set to recursive:

  • You're All Set!

CocoaPod iOS Installation

In your ios/Podfile make sure to use react-native-restart from the local node_modules/. With that, only your project Pod needs to be linked and no extra configuration is required:

target 'MyReactApp' do
  # Make sure you're also using React-Native from ../node_modules
  pod 'React', :path => '../node_modules/react-native', :subspecs => [
    'Core',
    'RCTActionSheet',
	# ... whatever else you use
  ]
  # React-Native dependencies such as yoga:
  pod 'yoga', path: '../node_modules/react-native/ReactCommon/yoga'

  # The following line uses react-native-restart, linking with
  # the library and setting the Header Search Paths for you
  pod 'react-native-restart', :path => '../node_modules/react-native-restart'
end

Remember to run cd ios && pod install to update files used by Xcode.

Usage

import RNRestart from 'react-native-restart'; // Import package from node modules

// Immediately reload the React Native Bundle
RNRestart.Restart();

Contributing

Contributions are welcome. Please see CONTRIBUTING.md if you like to contribute to this library.

Credits

Thanks to Microsoft CodePush library. I simply extracted the code from their library's logic to reload the React Native Bundle.

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].