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 */
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);
+ }
+ };
+ }
}
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
- Todos on Trello ( Invitation Link )
- Open an issue
- Fork
- Send PR
MIT
Free Software, Hell Yeah!