3 ms·
Text does feel like a really slow way to work sometimes. A while ago in a React app I needed to keep some state around so lifted it from component state hooks
by bambataa 4y ago
Text does feel like a really slow way to work sometimes.
A while ago in a React app I needed to keep some state around so lifted it from component state hooks to a context. Very mechanical work. It feels like we should be to say “move these to a context consumed by A, B, C” and just have it all done automatically.
Is there anything inherent to React/JS that stops something like IntelliJ implementing that?
- panstromek 4y ago> Is there anything inherent to React/JS that stops something like IntelliJ implementing that? Yes, actually. It's a problem for dynamic and weakly typed languages. IDE can't assume much properties about the program so it can't do many of the refactorings reliably. On top of that, React and many web frameworks build on some DSL (like JSX) and build-system specific project structure and source transforms that the IDE can't reason about very well. As a result, such refactorings often need to be implemented by the IDE for each specific framework separately. This is exactly the area where starting with a semantic model first would help a lot.