【发布时间】:2020-09-10 15:47:51
【问题描述】:
有没有办法将 [Lottie View]https://github.com/react-native-community/lottie-react-native 上的命令式 API 与功能组件一起使用?
我正在使用 Lottie View 组件,如下所示。我想要一种简单的方法来调用 play() 和 stop() 方法。我希望有一种方法可以在不将此组件转换为类的情况下做到这一点。
const GameInterface: React.FunctionComponent<GameInterfaceProps> = () => {
return (
<LottieView
source={require('./Data/data.json')}
/>
);
};
谢谢!
【问题讨论】:
标签: react-native lottie