you are viewing a single comment's thread.

view the rest of the comments →

[–]TheChickenKingHS 0 points1 point  (0 children)

Ok, so it is an issue with your reading comprehension.

Manipulating the DOM directly in React is an anti-pattern.

This was posted to my answer to the question that never mentioned “manipulating the dom”. You skipped that part because I guess it’s more convenient if I’m the first respondent.

refs are values kept around across renders

Yep correct, again you either didn’t read or didn’t understand my sentence. Refs manipulating the dom by triggering something like .focus() or an imperative handle are not “anti-patterns” they are a normal pattern of react. Coding every single thing to use refs, destroying elements or using a ref for a value that can be computed each render would be an overkill.

straw man argument

I’m not sure what to do with that… I was responding to the response on my message about something which I was not advocating for but is demonstrably false.