Replies: 1 comment 4 replies
-
You can't. In Remix, I recommend you consider the Full Stack Component pattern by @kentcdodds. Essentially you create a resource route (your API route) and export your UI component (SearchBar) from that route. Then in each of the routes you want to use your SearchBar component, you import it and render. All the logic for calling the resource route is encapsulated in the component. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
for example, SearchBar component will be used in different pages, i put it in app/components dir, but i can't use loader and action out of app/routers, what should i do?
Beta Was this translation helpful? Give feedback.
All reactions