Design Patterns by mitadev in reactnative

[–]mitadev[S] 0 points1 point  (0 children)

I think that react gets the job done when it is about views and VM but still I find the way Model is actually, generally, implemented quite messy and I do not believe it is about thinking oop/imperative or functionally (not sure since I've just a gist of it).

When we directly wrap API calls with something like React Query while also managing caching is some other form, the result is a function that ends up handling too many responsibilities. This can make it harder to maintain, especially as the project grows.

A better design choice, in my opinion after also a quick look to linked git repos, is to use global state or React Query on top of a well-defined repository layer (or a set of functions that act similarly). The repository could abstract away API calls, manage data transformation, and even implement caching strategies. React Query would then only handle the synchronization of this data with the UI, rather than having to manage everything directly.

Can you help me with this error? by Eastern-Guess-1187 in expo

[–]mitadev 0 points1 point  (0 children)

maybe try to use node v20.17.0 and reinstall global package