Adobe Animate.cc 2017的SnapSVG扩展能够为网络创建交互和动画。我目前正在尝试在我的REACT JS WebApplication中使用导出的SnapSVG Adobe Animate.cc项目。SnapSVGAnimator.js在React网络应用程序中加载时产生错误
什么我迄今所做的:
- 进口来自NPM snapsvg-CJS(修改snapsvg使用在阵营succesfull)
- 进口爱可信加载从SnapSVG扩展在生成的自定义JSON文件Animate.cc
从SnapSVGAnimator中排除eslintignore的缩小代码。 lib,在从Animate.cc发布SVG动画时生成,无需ESlinting警告即可正常工作。
创建componentDidMount功能
当前代码:
import React, {Component} from 'react';
import { Link } from 'react-router-dom';
import axios from 'axios';
import { SVGAnim } from './SnapSVGAnimator.js';
import snapsvg from 'snapsvg-cjs';
componentDidMount(){
axios.get(jsonfile)
.then(response => {
const json = response.request.responseText;
const comp = new SVGAnim(json);
console.log(comp)
});
}
问题,而我登录const comp
出现
跟踪误差。
Uncaught (in promise) TypeError:
_SnapSVGAnimator.SVGAnim is not a constructor