Is it possible to use a loader inside of a child comp? #9603
-
Hello, I'm trying to use a loader inside of a child but I get this prompt when I try to,
AccountInfo.jsx
Implementing the code exactly into the route / parent, the issue doesn't occur. So I was wondering if loaders can't be used inside of a child component? In my use case, if this isn't possible I'd just use an action loader and pass the info to the child, but I feel like this would be more efficient and less code. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Loaders are tied to routes, it's not possible to put a loader in that's not a route. |
Beta Was this translation helpful? Give feedback.
-
You can use the fullstack component pattern. Kent has an article about it https://www.epicweb.dev/full-stack-components. |
Beta Was this translation helpful? Give feedback.
Loaders are tied to routes, it's not possible to put a loader in that's not a route.