Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are we able to use React Query or a similar package in mad-core? #247

Open
tormodAase opened this issue Oct 25, 2023 · 0 comments
Open

Are we able to use React Query or a similar package in mad-core? #247

tormodAase opened this issue Oct 25, 2023 · 0 comments
Labels
feature New functionality

Comments

@tormodAase
Copy link
Contributor

Package / App

Other

Description

Ideally we want to use some package for data fetching. However, after doing some research, this was my findings:

After looking into this a bit more, implementing react query is more complicated than anticipated. In some apps we would end up with two query clients. It is possible to have more than one query client in an application, but the application's own query client would typically be in App.tsx, while core's query client would be in our navigation system. This means that mad-core's query client would be closer to the screens in the hierarchy, which means mad-core's query client would be used by default.

So there have multiple ways to implement this:

  1. Export a query client from mad-core and tell the developers to put it above their own query client in the hierarchy. Internally in mad-core we would use that query client, but it won't be used by default in other parts of the app (unless the developers want to use it).
  2. Put the query client inside the the core system, and tell the app developers to explicitly use their own context if they have their own query client.

If anyone has any suggestions on how we should proceed with data fetching in mad-core, please leave a comment here

Alternatives

No response

Other info

No response

@tormodAase tormodAase added the feature New functionality label Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality
Projects
None yet
Development

No branches or pull requests

1 participant