我想在我的打字稿项目中使用 react-awesome-reveal,但动画似乎不起作用。但是,当我使用 react-reveal 时它可以工作。请就我所缺少的提出建议。
import React, { Component } from "react";
import { render } from "react-dom";
import Hello from "./Hello";
import { Fade } from "react-awesome-reveal";
import ReactRevealFade from "react-reveal/Fade";
import "./style.css";
class App extends Component {
constructor() {
super();
this.state = {
name: "React"
};
}
render() {
return (
<div>
<Fade>
<Hello name={this.state.name} />
</Fade>
<ReactRevealFade left>
<Hello name={this.state.name} />
</ReactRevealFade>
<p>Start editing to see some magic happen :)</p>
</div>
);
}
}
render(<App />, document.getElementById("root"));
Stackblitz 代码:链接
任何帮助表示赞赏。