Skip to content

Conversation

@bertybot
Copy link
Contributor

@bertybot bertybot commented Sep 7, 2023

Problem

The Type for this section is invalid in most typescript configurations since there really is no way of typing this for the event. So, Typescript users may get unnecessarily frustrated copying this code.

Fix

Update docs section to use currentTarget which will make this docs section valid in typescript code.

As for the actual style of the fix I tried to keep it simple though it is kindof ugly with the chaining. So, please make an edit if you have a solution that more fits the style of the docs

Tests

I came across this while implementing something similar in my own code. I used this typing and it worked.

@changeset-bot
Copy link

changeset-bot bot commented Sep 7, 2023

⚠️ No Changeset found

Latest commit: 762d3b7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@benmccann benmccann changed the title docs: Fix Type for Form Action Example docs: fix type for form action example Sep 7, 2023
@benmccann benmccann added the documentation Improvements or additions to documentation label Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants