[Dropdown Menu] value propType is React.PropTypes.object
I think this shouldn't have a strict propType. If it must, it should be type number. In Select Fields, the example value property is an int.
In my case, I found this when I tried passing in a whole selected menuItem { payload: 1, text: "LAX" } as value to a SelectFields component. This allowed me to select a component but it wouldn't display. When I passed the selected item's payload as value, it worked properly but I received warning
Warning: Failed propType: Invalid prop `value` of type `number` supplied to `DropDownMenu`, expected `object`. Check the render method of `Filter`.
I think the fix would be to just remove the value property from Dropdown Menu's propTypes. I can make a PR if this is correct.
I think the fix would be to just remove the value property from Dropdown Menu's propTypes
Sorry, but I plan to move the documentation of each property from the doc to the source code.
And I also plan to enforce the eslint rule react/prop-types.
Can we instead use the oneOf option for the PropType validation?
Sure! Fine by me. I just wanted to be sure that I wasn't using the SelectField component improperly.
So that I can be sure, the value property should be of whatever type the valueMember property is on the menuItem, correct?
Should I go ahead with the PR to use oneOf then?
I just wanted to be sure that I wasn't using the SelectField component improperly
It seems that you are using it as in the documentation. It should be the right way to do.
Having a look at this line https://github.com/callemall/material-ui/blob/master/src/drop-down-menu.jsx#L207.
I would say that we can set the PropType of value to any.
Could you add it to the SelectField too?
edit: never mind, i had an old cached version. everything is good.