Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

188300239 Fix joining with a new table #102

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

tealefristoe
Copy link
Contributor

PT Story: https://www.pivotaltracker.com/story/show/188300239

A minor stylistic change I made in another recent PR caused a bug. Lesson learned: change as little as necessary. Especially if your project has no automated tests.

@@ -34,7 +34,7 @@ export const JoinWithoutMerging = (props: JoinWithoutMergingProps) => {
</button>
<button
disabled={!joinShareId || (!personalDataLabel && !lastPersonalDataLabel)}
onClick={joinShare}>
onClick={() => joinShare()}>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be a little better to not use the anonymous function and keep this as onClick={joinShare}?

In a previous change, it looks like you added the anonymous function so you could pass an argument. But you're no longer passing an argument here, so maybe it's not necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was quite surprised, but the change from () => joinShare() to joinShare is what caused the bug. I now realize that when it's just joinShare, the click event gets passed to joinShare as an argument, which the function definitely wasn't prepared to handle.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Good to know.

Copy link

@emcelroy emcelroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 I left a comment/question about a possible small change, but I don't think it's super important. And it's possible I'm missing a good reason why you made that choice.

@tealefristoe tealefristoe merged commit 042a2d4 into master Sep 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants