admin管理员组文章数量:1399939
I have a simple form with a material-ui DatePicker
, e.g:
<DatePicker name="startDate" autoOk={true} floatingLabelText="startDate" onChange={(x, event) => {console.log(arguments);}} />
However, if I change the date, an empty array is printed to the console. I would appreciate any suggestions on how to solve this.
"material-ui": "0.15.0"
"react": "15.1.0"
"react-tap-event-plugin": "1.0.0"
"redux": "3.0.5"
"redux-form": "^6.0.0-alpha.4"
I have a simple form with a material-ui DatePicker
, e.g:
<DatePicker name="startDate" autoOk={true} floatingLabelText="startDate" onChange={(x, event) => {console.log(arguments);}} />
However, if I change the date, an empty array is printed to the console. I would appreciate any suggestions on how to solve this.
"material-ui": "0.15.0"
"react": "15.1.0"
"react-tap-event-plugin": "1.0.0"
"redux": "3.0.5"
"redux-form": "^6.0.0-alpha.4"
Share
Improve this question
edited Jun 8, 2016 at 14:38
marcospereira
12.2k3 gold badges48 silver badges53 bronze badges
asked Jun 8, 2016 at 13:42
IslaIsla
2,4625 gold badges29 silver badges36 bronze badges
1 Answer
Reset to default 6What is "arguments"
that you are passing in console.log()
?
From the Date Picker documentation in material-ui:
Signature: function(null: undefined, date: object) => void null: Since there is no particular event associated with the change, the first argument will always be null. date: The new date.
Therefore your code bees:
onChange={(event, x) => {console.log(x);}}
where x
is the date.
Hope it helps.
本文标签: javascriptmaterialui componentsdatePickerno data passed to onChangeStack Overflow
版权声明:本文标题:javascript - material-ui components | datePicker | no data passed to onChange - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744157030a2593153.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论