rilyu / teaset

A UI library for react native, provides 20+ pure JS(ES6) components, focusing on content display and action control.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error: Unable to resolve module react-native/Libraries/Animated/src/Easing from D:\working_workspace\waterproof_project\6.code\newWaterproofApp\node_modules\teaset\components\ListRow\TouchableOpacity.js: react-native/Libraries/Animated/src/Easing could not be found within the project or in these directories:

HY88883 opened this issue · comments

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch teaset@0.7.5 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/teaset/components/ListRow/TouchableOpacity.js b/node_modules/teaset/components/ListRow/TouchableOpacity.js
index 8fc32cf..a4f1fb3 100644
--- a/node_modules/teaset/components/ListRow/TouchableOpacity.js
+++ b/node_modules/teaset/components/ListRow/TouchableOpacity.js
@@ -4,7 +4,7 @@ import React, {Component} from 'react';
 import PropTypes from 'prop-types';
 
 import {Platform, TouchableWithoutFeedback, Animated, ViewPropTypes} from 'react-native';
-import Easing from 'react-native/Libraries/Animated/src/Easing';
+import Easing from 'react-native/Libraries/Animated/Easing';
 import flattenStyle from 'react-native/Libraries/StyleSheet/flattenStyle';
 
 if (Platform.constants.reactNativeVersion.major === 0 && Platform.constants.reactNativeVersion.minor < 62) {

This issue body was partially generated by patch-package.

I faced same issue,
Hope to get right answer as soon as possible.
Thanks.

The same problem

commented

Add some configuration to babel.config.js

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    [
      require.resolve('babel-plugin-module-resolver'),
      {
        extensions: ['.js', '.png'],
        alias: {
          //
          'react-native/Libraries/Animated/src/Easing': 'react-native/Libraries/Animated/Easing',
        },
      },
    ]
  ],
};