关于typescript:ReactNative第三方库

31次阅读

共计 463 个字符,预计需要花费 2 分钟才能阅读完成。

依据第三方库地址集

lottie-react-native 动画库 github 以及官网

import React, {FC} from "react";
import {SafeAreaView, ScrollView, Text} from "react-native";
import Lottie from 'lottie-react-native';


interface Props {

}

const LottieReactNative: FC<Props> = () => {const animationRef = React.useRef<Lottie | null>(null);

    React.useEffect(() => {}, []);

    return <SafeAreaView>
        <ScrollView>
            <Lottie source={require('./animation.json')} autoPlay loop style={{width: 100}}/>
        </ScrollView>
    </SafeAreaView>;
};

export default LottieReactNative;

正文完
 0