<input type="text" className="numInput" onChange={(event)=>{ console.log(event.target.value); changeCount(cartId,event.target.value) }} value={defCount}/>使用框架為react+redux, 我再改變輸入框值時,會觸發onchange事件,但是在react渲染對value重新賦值時,會再次觸發onchange,我想只在改變輸入框值時觸發一次,請問大神如何解決呢?
react 渲染value時 onchange被多次觸發
翻閱古今
2018-12-20 14:14:24