請問,我該如何重寫這段代碼,以避免下面的錯誤?如何避免錯誤「標記上的Unknown prop <>從元素中刪除此prop」?
render() {
const { children, ...props } = this.props;
return <div {...props} ref={this.setRef}>{children}</div>
}
我得到這個錯誤:在標籤
未知道具onClickOutside
。從元素中刪除此道具。有關詳細信息(https://facebook.github.io/react/docs/higher-order-components.html#static-methods-must-be-copied-over)
你看到這個名單上'onClickOutside'? https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes – Maxwelll