3 ms·
So I have a react related question regarding the following stackoverflow solution. I find myself ignoring the warning in useEffect fairly often but wonder if t
by imetatroll 3y ago
So I have a react related question regarding the following stackoverflow solution. I find myself ignoring the warning in useEffect fairly often but wonder if the solution provided is a reasonable one or not?
https://stackoverflow.com/questions/64106594/is-the-useeffect-has-a-missing-dependency-warning-sometimes-wrong https://stackoverflow.com/questions/64106594/is-the-useeffec...
The situation I have in mind right now is a search field which updates a local useState value. When the user hits enter to trigger submit (or clicks submit), I want the useEffect to fire. At the same time I want to be able to clear the field and submit via another button.
I am probably not explaining it well but the missing dependency becomes a pain point in these situations. Is useRef basically what people end up using to work around it?
As for what the article above says, I do agree that the churn in the JS world in general is very exhausting. I guess it is filled with a lot of young "talent" who have endless time and energy at their disposal.
- pas 3y agothe churn is because iteration-by-iteration we're moving closer to something that is just right. but that goal is also constantly changing. (not to mention that the webdev community is not a hivemind, so it makes sense that there are many tools, and many new tools.) and after a few iterations it makes sense to do a jump in some non-functional metric (vite, deno/bun), or do a vertical integration (vercel), and then new tools target those platforms, and ... if it's exhausting stop chasing the new shiny thing, and just use Angular like normal people. or HTMX :p