I have an issue that I don't know what to do with. https://material-ui.com/components/autocomplete/#combo-box check that they rely on the ordering of the props
<TextField {...params} label="Combo box" variant="outlined" />
anything passed after ...params overwrites what params had with the same name. How can I do this with helix?I think I can do js/Object.assign but the more I think about it the more I want to avoid the whole issue, this shouldn't be needed
Helix supports & and :& props spread notation!
see https://github.com/lilactown/helix/blob/master/docs/creating-elements.md
I replied to your question below (not threaded)
See dynamic props section ^
I am not sure, if you did.
In fact, I am sure you did not.
@quilesbaker as I explicitly stated in my question, it is important to notice that the order in the example is not the same as the one used by the spread macro, which I was using already, btw.
would be nice to have an online playground to try it out though, as far as I can remember, if I didn't put the & args
pair at the end, it didn't work
and now I am having an even weirder problem, a maxWidth prop only works if I pass it as string, if I pass it bound to a symbol, then it doesn't. I feel like i need some days off.
@ashnur Are params coming in as a cljs map via bean? Could you just do ($ TextField {:& (merge params {:label …})})
? Or maybe use bean itself?
no, these are passed here, and yes, this is the last time I use this component https://github.com/mui-org/material-ui/blob/33850e52ca32787fbc02b64d3225bac2d451612c/packages/material-ui/src/Autocomplete/Autocomplete.js#L584
this worked 😄
helix's spread props and props conversion to a JS object only works on the first level of the TextField
props map. so the :InputProps
needs to be handled just like you did
by passing a JS obj
I think the advice here was right based on the info given. that context was missing
rights and wrongs are decided on another level than what it means to me then, because to me it just felt like a rtfm