Where do you put server actions that are scoped to a component rather than a page?
Answered
Florian posted this in #help-forum
FlorianOP
I use this
PostInput component in different places. I'm unsure where to put the corresponding server action 🤔 Inside the components folder feels wrong.9 Replies
@Florian I use this `PostInput` component in different places. I'm unsure where to put the corresponding server action 🤔 Inside the components folder feels wrong.
I keep mine inside the matching folder to know, that all actions about this path (also components) are inside this actions file
@B33fb0n3 I keep mine inside the matching folder to know, that all actions about this path (also components) are inside this actions file
FlorianOP
I do that too if the actions belong to a page. But in my example, they belong to a reusable component that's not tied to a specific page. Hence my confusion.
@Florian I do that too if the actions belong to a page. But in my example, they belong to a reusable component that's not tied to a specific page. Hence my confusion.
then I would put the action where my component is
Answer
@B33fb0n3 yes
FlorianOP
thank you
happy to help. Please mark solution
FlorianOP
I'm still interested in other opinions