@nutui/nutui-react
Version:
京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序
23 lines (22 loc) • 976 B
JavaScript
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
import { _ as _object_without_properties } from "@swc/helpers/_/_object_without_properties";
import LottieReact from "lottie-react";
import React, { useImperativeHandle, useRef } from "react";
export var Lottie = /*#__PURE__*/ React.forwardRef(function(props, ref) {
var loadingLottieRef = useRef(null);
var style = props.style, source = props.source, autoPlay = props.autoPlay, rest = _object_without_properties(props, [
"style",
"source",
"autoPlay"
]);
useImperativeHandle(ref, function() {
return loadingLottieRef.current;
});
return /*#__PURE__*/ React.createElement(LottieReact, _object_spread_props(_object_spread({}, rest), {
lottieRef: loadingLottieRef,
animationData: source,
style: style
}));
});
Lottie.displayName = 'NutLottie';