Skip to content

Confused how to work with components and loader/post method's #1593

Closed Answered by hollandThomas
gijsroge asked this question in Q&A
Discussion options

You must be logged in to vote

You can create React components as usual and use Remix's <Form> inside of them. Forms have the action attribute, and as the docs state:

Most of the time you can omit this prop. Forms without an action prop (<Form method="post">) will automatically post to the same route within which they are rendered. This makes collocating your component, your data reads, and your data writes a snap.
If you need to post to a different route, then add an action prop:

<Form action="/projects/new" method="post" />

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@gijsroge
Comment options

@hollandThomas
Comment options

@gijsroge
Comment options

Answer selected by gijsroge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants