Description
📚 Subject area/topic
Reference
📋 Page(s) affected (or suggested, for new content)
- https://docs.solidjs.com/solid-router/reference/data-apis/use-submission
- https://docs.solidjs.com/solid-router/reference/data-apis/use-submissions
📋 Description of content that is out-of-date or incorrect
The problem
The useSubmission(s)
documentation focuses a lot on form submissions, which I think is misleading. It introduces useSubmission
mainly as a tool for handling form submissions. However, as I understand it, even when using useAction
to invoke an action, the submission details are still available through useSubmission(s)
. This means useSubmission(s)
is not just for forms.
The documentation also says:
It's important to note that
useSubmission
requires the form method to be post otherwise it will trigger a browser navigation and will not work.
This makes it seem like useSubmission(s)
depends on form submissions, but the need for method="post"
is actually about how actions handle form submissions, not about useSubmission(s)
itself.
This becomes a problem when trying to remove the Creating the action section. In a related issue, I suggested removing it because it seemed unrelated. But when I tried to remove it in a pull request, I realized it was the only part that explained the link between submissions and actions. This forced us to awkwardly clarify that submissions are really about actions.
If users get halfway through the useSubmission(s)
reference page without realizing it is mainly about actions, then the documentation is not clear enough.
Proposed Solution
I suggest rewriting the useSubmission(s)
reference page from the beginning through the end of "Creating the action" section.
Instead of focusing on form submissions, the documentation should explain useSubmission(s)
as a way to access an action's invocation/submission details/state. This way, we don’t need to say things like "To trigger a submission, actions can be used," because it will already be clear. Also, this would better describe what useSubmission(s)
actually does.
🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)
No response