|
|
|
|
|
by alexey2020
1651 days ago
|
|
>But in the article, you wrote: I also wrote a bit below: "be transparent to components and not affect their logic in any way (make components think they communicate to Backend directly)" I met people trying to use ReactQuery with the mindset that it's a Store. The result was that they were greatly frustrated with the outcome. That mindset led them to use ReactQuery in a way it's not supposed to be used. Every now and then they wanted to directly manipulate with the Cache (the "Store" underneath ReactQuery). That's why I find that Store-mindset very dangerous when working with such Libraries. Better come with a mindset that there is no Store at all. Better think that "useBookQuery" is just a simple hook to fetch data. NO STORE. >To me, “directly communicating with the backend” implies that I have to have REST calls in my components, and handle all that comes with that This is exactly what I meant :) I'm glad that you found the article useful. Thanks again for providing your feedback! |
|
I have more questions about whether ReactQuery can help me out when working with a bad legacy API, but I don’t know how to ask them clearly. It would be unfair to ask you to understand the system I’m working with, especially when you’ve already written an article that clearly describes the idea and have been so generous with your responses. I will be looking at this more deeply for sure.
This kind of thing is why I come to HN.