핸들러 함수에 이벤트 객체 대신 프록시 객체를 전달 반작용 (버전 1.5.2 반응) : "EVT"로가 구성 요소 내가 반응 다음과 같은 구성 요소를 준비했습니다
var QuickSearch = React.createClass({
searchHandler: function(){
this.props.parent.props.dataSource.search = this.refs.SearchInput.value;
this.props.parent.props.dataSource.setPage(1);
this.props.parent.getData();
},
refreshHandler: function(){
this.props.parent.props.dataSource.search = this.refs.SearchInput.value;
this.props.parent.getData();
},
myEventHandler: function(evt){
console.log(evt);
if(evt.keyCode === 13) {
evt.stopPropagation();
this.searchHandler();
}
},
render: function(){
/* Translation function from table model */
_ = this.props.parent.props.table_model.gettrans;
return(
<div className="reactable-quicksearch-wrapper">
<input ref="SearchInput" type="text" onKeyPress={this.myEventHandler} placeholder={_('Search phrase...')} />
<button ref="SearchButton" type="button" onClick={this.searchHandler}>{_('Search')}</button>
<button ref="RefreshButton" type="button" onClick={this.refreshHandler}>{_('Refresh')}</button>
</div>
);
}
});
이 MyEventAPIHandler 기능을 프록시 "대상"을 포함하는 객체 (기본적으로 입력) 및 핸들러 전달합니다
Proxy { <target>: Object, <handler>: Object }
내가 더 있는지를 생각하지 왜,하지만 "S처럼 행동하는 것 ubmit "(??) 어쨌든, 내가 읽은 반응에서 표준 이벤트 객체를 전달해야하지만 그렇지 않습니다.
어떤 종류의 문제가 발생할 수 있습니까?