reagent

tatut 2024-09-19T08:35:15.617229Z

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

juhoteperi 2024-09-19T08:38:36.315419Z

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

juhoteperi 2024-09-19T08:39:10.594409Z

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

tatut 2024-09-19T08:39:16.507219Z

thatโ€™s not in 1.2.0 release?

juhoteperi 2024-09-19T08:40:18.552489Z

It is

tatut 2024-09-19T08:42:06.581509Z

ah yes, found it

tatut 2024-09-19T08:42:24.809409Z

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

juhoteperi 2024-09-19T08:45:25.081409Z

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.

tatut 2024-09-19T08:46:06.637249Z

I will give it a try, thanks

Harold 2024-09-19T16:31:57.723489Z

> 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?

tatut 2024-09-20T05:11:46.187009Z

afaict, yes you set the value on each keystroke

tatut 2024-09-20T05:12:44.542369Z

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

juhoteperi 2024-09-20T07:18:00.448319Z

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

juhoteperi 2024-09-20T07:18:44.007129Z

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

juhoteperi 2024-09-20T07:19:21.337129Z

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.

Harold 2024-09-20T15:38:58.109769Z

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

2024-09-22T21:16:44.512159Z

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.

Harold 2024-09-23T02:50:02.060029Z

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

๐Ÿ‘ 1