helix

https://github.com/Lokeh/helix
Aron 2021-05-07T08:22:49.061600Z

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?

Aron 2021-05-07T08:51:53.062500Z

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

teh0xqb 2021-05-07T12:19:49.063200Z

Helix supports & and :& props spread notation!

teh0xqb 2021-05-07T12:21:06.063900Z

I replied to your question below (not threaded)

teh0xqb 2021-05-07T12:21:40.064400Z

See dynamic props section ^

Aron 2021-05-07T12:25:05.064500Z

I am not sure, if you did.

Aron 2021-05-07T12:27:17.064700Z

In fact, I am sure you did not.

Aron 2021-05-07T12:31:10.067500Z

@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.

Aron 2021-05-07T12:32:54.068300Z

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

Aron 2021-05-07T14:09:31.069300Z

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.

dominicm 2021-05-07T14:45:28.071300Z

@ashnur Are params coming in as a cljs map via bean? Could you just do ($ TextField {:& (merge params {:label …})})? Or maybe use bean itself?

Aron 2021-05-07T15:20:19.071900Z

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

Aron 2021-05-07T15:23:15.072900Z

https://imgur.com/a/oz7JXj3

Aron 2021-05-07T15:23:18.073200Z

this worked 😄

lilactown 2021-05-07T15:50:14.074100Z

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

lilactown 2021-05-07T15:50:20.074300Z

by passing a JS obj

lilactown 2021-05-07T15:50:55.075100Z

I think the advice here was right based on the info given. that context was missing

Aron 2021-05-07T16:19:06.076Z

rights and wrongs are decided on another level than what it means to me then, because to me it just felt like a rtfm