How to use react query data in another component without moving state up?
I am using nextjs app router + typescript + react-query. Currently my app has an input that asks a user for a url, which is then used to fetch a list of github issues. Here are the simplified versions of the files:
url-form.tsx:
page.tsx (Home):
use-issues.tsx:
Now what I want to do is access the list of issues in another component in order to render the list onto the UI. However, I would like to avoid bringing the url state upto the home component and passing it down into the new component as I want to keep the home component a server component. What is the next best way to access the data in a new component?
0 Replies