import React, { Component, Fragment } from "react";
import PreviewPanel from "./containers/PreviewPanel";
import { CSSTransition } from "react-transition-group";
class App extends Component {
render() {
return (
<Fragment>
<PreviewPanel></PreviewPanel>
<CSSTransition></CSSTransition>
</Fragment>
);
}
}
export default App;这是不变的违规:最小化的反应错误#143。当我删除CSSTransition块时,它工作正常。请告诉我如何正确使用CSSTransitoin?
发布于 2020-05-26 01:50:33
https://github.com/reactjs/react-transition-group/blob/master/src/Transition.js#L400:CSSTransition想要一个孩子,但你还没有给他
children: PropTypes.oneOfType([
PropTypes.func.isRequired,
PropTypes.element.isRequired,
]).isRequired,当您实际为元素设置动画时,错误应该会消失。
https://stackoverflow.com/questions/62007525
复制相似问题