关于新老版本的react定义组件的方式~在Main.js中同样适用的原因是什么?
老版本的react是通过var ImgFigure = React.createClass{}来定义组件,新版本是通过class AppComponent extends React.Component{}来定义组件,但是我试了下,为什么react-webpack里在Maim.js下,利用这两种方式都能正确编译react呢?是通过什么插件的帮助?有没有大神帮忙解惑?万分感谢~~~
老版本的react是通过var ImgFigure = React.createClass{}来定义组件,新版本是通过class AppComponent extends React.Component{}来定义组件,但是我试了下,为什么react-webpack里在Maim.js下,利用这两种方式都能正确编译react呢?是通过什么插件的帮助?有没有大神帮忙解惑?万分感谢~~~
2018-03-16
举报