Skip to content

Conversation

thomasboyt
Copy link

See #173 for previous discussion.

Copy link
Member

Choose a reason for hiding this comment

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

I think the code is pretty clear here, no need for the comment :)

@ryanflorence
Copy link
Member

@spicyj thumbs up?

Copy link
Member

Choose a reason for hiding this comment

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

do we need to check if this exists first? Or maybe provide a default noop function?

Copy link
Contributor

Choose a reason for hiding this comment

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

This might be a little clearer as:

var ret = this.props.onClick(event);
// `false` prevents default; `undefined` does not
if (ret === false) {
  allowTransition = false;
}

and then just if (allowTransition) at the bottom; it wasn't clear to me on a first reading why you were comparing to false down there.

Copy link
Member

Choose a reason for hiding this comment

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

I did the same thing, actually. 👍

@thomasboyt
Copy link
Author

Updated! Thanks for the feedback; should be a bit cleaner now

@ryanflorence
Copy link
Member

can you squash and force push? would be nice to be just one commit

@thomasboyt
Copy link
Author

sure, done

ryanflorence added a commit that referenced this pull request Aug 8, 2014
[added] onClick handler to <Link />
@ryanflorence ryanflorence merged commit 75c9a80 into remix-run:master Aug 8, 2014
Copy link
Contributor

Choose a reason for hiding this comment

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

um, defaultPrevented?

Copy link
Member

Choose a reason for hiding this comment

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

/facepalm I should have caught that

Copy link
Member

Choose a reason for hiding this comment

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

@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants