Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

leandrosimoes/react-native-template-ls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Native Template LS

Codacy Badge npm version Node.js Package

Leandro Simões React Native Template

Installation

react-native init YOUR_APPLICATION_NAME --template ls

PS: You must use the @react-native-community/cli instead of react-native-cli.

Aditional configurations

Android

This is necessary to enable the react-native-gesture-handler (E.g. pen the drawer navigation gestures)

android/app/src/main/java/com/YOUR_APPLICATION_NAME/MainActivity.java

package com.your_application_name;

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 "YOUR_APPLICATION_NAME";
  }

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

IOS

Don't forget to execute the pod install command inside the ios folder

Last React and React Native version tested:

{
  "react": "17.0.2",
  "react-native": "0.65.0",
}