reagent 2024-09-19

so afaict React 18 can be used with Reagent, but it will work as if running React 17 (as per the console error message)

there is the new reagent.dom.client ns to get React working through the new APIs

enabling React 18 batching might have some side-effects \o/

thatโ€™s not in 1.2.0 release?

ah yes, found it

so I can basically try that instead of render and see if it works for my app

Yeah. I guess the controlled inputs are case where people have had problems. Most projects where I work are still using the old non-concurrent renderer, i.e. 17 mode.

I will give it a try, thanks

> controlled inputs are case where people have had problems @juhoteperi - This sounds relevant to my interests, when you say 'controlled inputs', do you mean [:input ...] elements with :value and :on-change? Or something else?

afaict, yes you set the value on each keystroke

also, I wonder what percentage of reagent code works with 18โ€ฆ when should it become the default, it has been out for 2 years now

@hhausman :value, it doesn't matter how the value is being updated but yes in practice you would also have :onChange

And the workaround is especially needed when the value is being controlled (changed) AND user has cursor in the input

I think all other parts (hiccup-like data to react elements) etc. works fine with React 18, it just Reagent batching + React batching together which is non optimal.

Ah, all of our :inputs work this way. What is the problem/workaround? Can you link something for me to read on the subject?

Note that I think there are a few cases where the input jumping cursor may not be fixable at all that I know of. It depends on the type of input. This came up a few days back. I had to find a thread. I think it is for type number and date that have problems I do not have any good workarounds.

Profoundly interesting - will have to keep an eye out, thank you for this info ๐Ÿ™‡

๐Ÿ‘ 1