rum

Simple, decomplected, isomorphic HTML UI library for Clojure and ClojureScript | 0.12.8 https://github.com/tonsky/rum/blob/gh-pages/CHANGELOG.md#0128
jrychter 2017-07-16T11:12:19.699545Z

In the render fn, is there a way to force a child component to be re-created from scratch? E.g. if one of my args changes, I don't want to just pass the changed arg down the tree, because I know the child will not be able to deal with the change. I want to destroy the child and re-create it.

jrychter 2017-07-16T11:12:56.701568Z

And yes, I know this is not the expected way to use React. I hit a corner case (complex forms where the number of fields can change).

2017-07-16T11:45:18.813407Z

@jrychter yes, provide and unique key

2017-07-16T11:45:36.814328Z

an unique key

jrychter 2017-07-16T11:45:45.814837Z

Oh!

2017-07-16T11:45:56.815400Z

React can't reuse component if key is different

2017-07-16T11:46:15.816458Z

I used it myself once, to clear the form too :))

jrychter 2017-07-16T11:46:30.817298Z

There you go! You saved me a fantastic amount of time, thanks.

jrychter 2017-07-16T11:47:17.820274Z

My forms library (rather extensive by now) assumes that the form manages tons of local state. I don't see a way to reconcile this with the number of fields changing. It's easier to just recreate the form in that case.

jrychter 2017-07-16T11:49:45.828806Z

TFW you wrote a declarative forms library, and now you auto-generate data for it and use gensym

martinklepsch 2017-07-16T13:43:38.269332Z

forms libraries, oh the joy

martinklepsch 2017-07-16T13:43:49.269986Z

here are some of my previous approaches 😄 https://gist.github.com/martinklepsch/e1366008c5a478b33c00d324314da4fd

jrychter 2017-07-16T22:03:57.703343Z

@martinklepsch after about, oh, 12 years or so of thinking about the problem (and after having built at least five) I feel slightly more qualified as far as forms libraries are concerned 🙂

jrychter 2017-07-16T22:05:53.711695Z

And so far I'm pretty happy with the current one, not that it's ideal or anything.