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

麻烦兼容下rn 0.64.0

ivanzhang2 opened this issue · comments

commented

文件
components/ListRow/TouchableOpacity.js
修改
import Easing from 'react-native/Libraries/Animated/src/Easing';

import Easing from 'react-native/Libraries/Animated/Easing';

可以直接这样更改,新旧RN版本都兼容

import {Platform, TouchableWithoutFeedback, Animated, ViewPropTypes, Easing} from 'react-native';

嫌麻烦可以用下我的私包,不过相比原项目改动较多
https://github.com/yz1311/teaset

文件
components/ListRow/TouchableOpacity.js
修改
import Easing from 'react-native/Libraries/Animated/src/Easing';

import Easing from 'react-native/Libraries/Animated/Easing';

我这边改过了,目前不报错了,但是还是没有任何效果

我已经解决了,使用 本来是想要使用 Toast.message('Toast message'); 这个方法,但是没有办法显示,后面加了一下参数,使用的是自定义部分的就OK了
static customKey = null;

showCustom() {
if (ToastExample.customKey) return;
ToastExample.customKey = Toast.show({
text: 'Toast custom',
icon: ,
position: 'top',
duration: 1000000,
});
}

hideCustom() {
if (!ToastExample.customKey) return;
Toast.hide(ToastExample.customKey);
ToastExample.customKey = null;
}

可以直接这样更改,新旧RN版本都兼容

import {Platform, TouchableWithoutFeedback, Animated, ViewPropTypes, Easing} from 'react-native';

嫌麻烦可以用下我的私包,不过相比原项目改动较多
https://github.com/yz1311/teaset
还是不行,复制命令下载要报错

@letterz 这个我是在线上用的,包不行的话,你用着patch-package改下原包也行

你百度下patch-package不早就出来了

文件
components/ListRow/TouchableOpacity.js
修改
import Easing from 'react-native/Libraries/Animated/src/Easing';

import Easing from 'react-native/Libraries/Animated/Easing';

补充一下:
我修改后不报错了,但没效果。
因为我的背景是默认的那种背景,类似白色,而teaset的ThemeDefault中,defaultcolor是“#fff”
然后我试着修改了一下teaset的Theme,在入口处增加:
import {Theme} from 'teaset';
Theme.set(Theme.themes.black);
然后toast就显示了出来。

这个teaset不能用对我来说还是挺麻烦的,作为一个新人现在在一个团队里面做事,负责前端,弄不出来就很尴尬

------------------ 原始邮件 ------------------ 发件人: "rilyu/teaset" @.>; 发送时间: 2021年7月5日(星期一) 上午9:51 @.>; @.@.>; 主题: Re: [rilyu/teaset] 麻烦兼容下rn 0.64.0 (#444) @letterz 这个我是在线上用的,包不行的话,你用着patch-package改下原包也行 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

https://juejin.cn/post/6962554654643191815
https://juejin.cn/post/6844904104838299661
你看看这个有用不,我也是新手

commented

Hi,

Does someone know how to solve this issue Unable to resolve module react-native/Libraries/Animated/src/AnimatedEvent ?

Hi,

Does someone know how to solve this issue Unable to resolve module react-native/Libraries/Animated/src/AnimatedEvent ?

cmd + P search TouchableOpacity.js

change:

import Easing from 'react-native/Libraries/Animated/Easing';