docs: add "name" attribute to text input form element in AddPostForm.… #4829
+28
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…tsx to maintain consistency with EditPostForm.tsx
name: 📝 Documentation Fix
about: Fixing a problem in an existing docs page
Checklist
yarn lintjust in case but nothing changed.What docs page needs to be fixed?
4 sections across 3 pages involving the
AddPostForm.tsxcomponent fileOccurrence 1: https://redux.js.org/tutorials/essentials/part-3-data-flow#adding-new-posts
Occurrence 2: https://redux.js.org/tutorials/essentials/part-3-data-flow#dispatching-the-post-added-action
Occurrence 3: https://redux.js.org/tutorials/essentials/part-4-using-data#adding-authors-for-posts
Occurrence 4: https://redux.js.org/tutorials/essentials/part-7-rtk-query-basics#using-mutation-hooks-in-components
What is the problem?
To preface, the code already works without the name attribute, since the submission handling code intercepts the default form event and instead relies on the element ids. However, I've noticed that the similar
EditPostForm.tsxcomponent has the name attribute for both the text and textarea input. I figured adding the name attribute to the input element toAddPostForm.tsxmay help with consistency.Admittedly, as I was going through the essential docs as a learner, there was a moment of confusion/self-doubt around the lines of "wait why does this input not have 'name', but the one on EditPostForm does? is this a special redux thing i'm missing?" haha
Also, I'm not sure what I'm doing to fail github workflow checks, only
.mdfiles have been edited :(What changes does this PR make to fix the problem?
Adds
name="postTitle"in all relevantAddPostForm.tsxsnippets I could find.