redux icon indicating copy to clipboard operation
redux copied to clipboard

docs: add "name" attribute to text input form element in AddPostForm.…

Open Talos0248 opened this issue 1 week ago • 2 comments

…tsx to maintain consistency with EditPostForm.tsx


name: :memo: Documentation Fix about: Fixing a problem in an existing docs page

Checklist

  • [ ] Is there an existing issue for this PR?
    • Nope! I think directly opening a pull request and discussing there is a better approach, according to my best judgement.
  • [x] Have the files been linted and formatted?
    • Ran yarn lint just in case but nothing changed.

What docs page needs to be fixed?

4 sections across 3 pages involving the AddPostForm.tsx component file

Occurrence 1: https://redux.js.org/tutorials/essentials/part-3-data-flow#adding-new-posts

  • Section: Adding New Posts
  • Page: Redux Essentials, Part 3: Basic Redux Data Flow

Occurrence 2: https://redux.js.org/tutorials/essentials/part-3-data-flow#dispatching-the-post-added-action

  • Section: Dispatching the Post Added Action
  • Page: Redux Essentials, Part 3: Basic Redux Data Flow

Occurrence 3: https://redux.js.org/tutorials/essentials/part-4-using-data#adding-authors-for-posts

  • Section: Adding Authors for Posts
  • Page: Redux Essentials, Part 4: Using Redux Data

Occurrence 4: https://redux.js.org/tutorials/essentials/part-7-rtk-query-basics#using-mutation-hooks-in-components

  • Section: Using Mutation Hooks in Components
  • Page: Redux Essentials, Part 7: RTK Query Basics

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.tsx component has the name attribute for both the text and textarea input. I figured adding the name attribute to the input element to AddPostForm.tsx may 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 .md files have been edited :(

What changes does this PR make to fix the problem?

Adds name="postTitle" in all relevant AddPostForm.tsx snippets I could find.

Talos0248 avatar Dec 10 '25 10:12 Talos0248

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

codesandbox-ci[bot] avatar Dec 10 '25 10:12 codesandbox-ci[bot]

Deploy Preview for redux-docs ready!

Name Link
Latest commit 1447204385c108d6632c1123651e5e4ac50d26f6
Latest deploy log https://app.netlify.com/projects/redux-docs/deploys/6939482c0eca21000844257f
Deploy Preview https://deploy-preview-4829--redux-docs.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Dec 10 '25 10:12 netlify[bot]