1.2.0 • Published 1 year ago

twc-hra-react-native v1.2.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Installation

Run this commond First:-

npm i twc-hra-react-native --legacy-peer-deep

Now add this following code in your project.

  1. Add these lines in your android/settings.gradle.
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir,'../node_modules/react-native-linear-gradient/android')
include ':lottie-react-native'
project(':lottie-react-native').projectDir = new File(rootProject.projectDir,'../node_modules/twc-hra-react-native/node_modules/lottie-react-native/src/android')
  1. Add these lines in your android/app/build.gradle.
implementation project(':react-native-linear-gradient')
implementation project(':lottie-react-native')
  1. Add these lines in your android/app/src/main/java/com/{YOUR_APP_NAME}/MainApplication.java.
import com.BV.LinearGradient.LinearGradientPackage;
import com.airbnb.android.react.lottie.LottiePackage;


// Add these in getPackages methods

packages.add(new LinearGradientPackage());
packages.add(new LottiePackage());

Also add this in your metro.config.js

const { getDefaultConfig } = require('metro-config');

module.exports = (async () => {
  const {
    resolver: { sourceExts, assetExts },
  } = await getDefaultConfig();
  return {
    transformer: {
      babelTransformerPath: require.resolve('react-native-svg-transformer'),
    },
    resolver: {
      assetExts: assetExts.filter(ext => ext !== 'svg'),
      sourceExts: [...sourceExts, 'svg'],
    },
  };
})();