redux-form-material-ui icon indicating copy to clipboard operation
redux-form-material-ui copied to clipboard

helperText is not a valid property on the material-ui Select in next

Open bmmathe opened this issue 7 years ago • 5 comments

When making a Select field required I get the error below. In mapError.js helperText is being set if there is an error. This works for most of the components but Select no longer has a helperText.

Warning: Unknown prop helperText on

tag. Remove this prop from the element. For details, see https://fb.me/react-unknown-prop in div (created by Input) in Input (created by withStyles(Input)) in withStyles(Input) in Select (created by withStyles(Select)) in withStyles(Select) (created by ReduxFormMaterialUIStyle) in ReduxFormMaterialUIStyle (created by ConnectedField) in ConnectedField (created by Connect(ConnectedField)) in Connect(ConnectedField) (created by Field) in Field (created by ContactForm) in div (created by FormControl) in FormControl (created by withStyles(FormControl)) in withStyles(FormControl) (created by ContactForm)

bmmathe avatar Oct 25 '17 23:10 bmmathe

I was looking at different ways to work around this or provide an option to send in a helperText but something got me caught up in the Select.js file. There is syntax that is blowing my mind and I can't seem to get a simple codepen working to help me understand what is going on.

Essentially the Select.js file is structured like this: createComponent(Select, ({}) => ({}));

My question is, what is this doing? ({}) => ({}) or can someone shoot me a link to help me understand what syntax this is. I know it's an arrow function which I'm familiar with but typically the syntax is: var x = () => {}. I have never seen an arrow function being used for an input parameter before.

My next question is, it looks like the values on the left are being spread somehow but I don't see a spreader operator. The reason I say this is because on the right is this line value: value which I would have assumed should have been written value: input.value. I'm obviously missing something.

EDIT: after more research it looks like createComponent takes in a mapProps argument. Presumably this is a function because of ...mapProps(this.props). So does that mean ({})=>({}) this syntax is shorthand for function({}) { return function({}) {} }

bmmathe avatar Oct 26 '17 01:10 bmmathe

same issue here. Any solutions to this?

PharrellWANG avatar Jan 05 '18 05:01 PharrellWANG

It seems, helperText is part of MUI not part of this library. Could you double check ?

mihirsoni avatar Jan 09 '18 06:01 mihirsoni

https://github.com/erikras/redux-form-material-ui/issues/208 seems related

thehig avatar Jan 11 '18 16:01 thehig

same here..

kaleem-elahi avatar Feb 27 '18 11:02 kaleem-elahi