engineerahkhani / elegant-react-native

Elegant React Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Elegant React Native ( WIP )

Installation

Install React Native cli and requirements

git clone https://github.com/iran-react-community/elegant-react-native.git
cd elegant-react-native
yarn
nano app.json /* here we go to edit project name and displayName */
react-native eject /* generate ios and android folders */
react-native link /* add app/assets/fonts and react-native-vector-icons  */
cd ios && pod install && cd ../ && yarn ios
yarn android /* android */

Additional Steps (Android)

Update your MainActivity.java file

package com.swmansion.gesturehandler.react.example;

import com.facebook.react.ReactActivity;
+ import com.facebook.react.ReactActivityDelegate;
+ import com.facebook.react.ReactRootView;
+ import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;

public class MainActivity extends ReactActivity {

  @Override
  protected String getMainComponentName() {
    return "Example";
  }

+  @Override
+  protected ReactActivityDelegate createReactActivityDelegate() {
+    return new ReactActivityDelegate(this, getMainComponentName()) {
+      @Override
+      protected ReactRootView createRootView() {
+       return new RNGestureHandlerEnabledRootView(MainActivity.this);
+      }
+    };
+  }
}

Enable Hermes

Edit your android/app/build.gradle file and make the change illustrated below:

  project.ext.react = [
      entryFile: "index.js",
-     enableHermes: false  // clean and rebuild if changing
+     enableHermes: true  // clean and rebuild if changing
  ]
cd android && ./gradlew clean && cd ../  && yarn android

Contribution

License

MIT

Free Software, Hell Yeah!

About

Elegant React Native

License:MIT License


Languages

Language:JavaScript 100.0%