當我使用這行: this.state.selectedJobType.length > 0 ?
''
:
this.setState({ jobTypeErrMsg: 'Please select at least one job type'});
它拋出錯誤: warning Expected an assignment or function call and
我已經證明這個功能... /**
* Perform an asynchronous HTTP (Ajax) request.
*
* @param {String|Object} url A string containing the URL to which the request is sent, or the settings object.
* @param {Object=}
在eslint規則guard-for-in中,直接使用for in不正確。好的做法是 for (key in foo) {
if (Object.prototype.hasOwnProperty.call(foo, key)) {
doSomething(key);
}
if ({}.hasOwnProperty.call(foo, key)) {