如何在React中使用jQuery UI?我在Googling看过几个例子,但所有这些例子似乎都已经过时了.
我正在使用Semantic UI和ES6 JS中的React构建一个简单的登录表单.下面的代码按预期运行.我想知道我是否以正确的方式做事并遵循React惯例:
constructor(props) {
super(props);
// this is getInitialState()
this.state = {
emailaddress: '',
password: '',
errors: ''
};
}
componentDidMount() {
$('.ui.form').form({
fields: {
email: {
identifier : 'emailaddress',
rules: [
{
type : 'empty',
prompt : 'Please enter your e-mail'
},
{
type : 'email',
prompt : 'Please enter a valid e-mail'
}
]
},
password: {
identifier : 'password',
rules: [
{
type : 'empty',
prompt : 'Please enter your password'
},
{
type : 'length[6]', …Run Code Online (Sandbox Code Playgroud) 我们正试图制定一个利弊列表,从Angular转移到Flux + React,并附带这个原始列表.
任何人都可以对辩论作出反应(看看我在这里做了什么?)并证明不然?(请特别针对每次辩论,而不是关于libs的一般性讨论).
谢谢!
--------------------------------------------------------------------
| Angular | React + Flux
--------------------------------------------------------------------
Version | 1.+ major version. | React 0.13 - not version 1 (
| Supported. | minor) - not finalized, can be
| 2.0 - migration | changed drastically.
| possible easily | Flux 2.1.
--------------------------------------------------------------------
Age | 6 years (easier find | react 2 years
| developers) |
--------------------------------------------------------------------
Framework | Yes, MVC | React is only view. Flux is a
| | pattern, not MVC. …Run Code Online (Sandbox Code Playgroud)