Skip to content

Conversation

benvinegar
Copy link
Contributor

Not sure if StrictClick should have it's own onClick prop, or it should just override the top-most child's onClick prop. I chose the former ... but I'm okay with either.

/cc @getsentry/ui

},

render() {
return React.cloneElement(this.props.children, {
Copy link
Contributor

Choose a reason for hiding this comment

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

If this is cloning the children, does this end up with two layers in DOM? An <ol> inside an <ol>? Or am I just misunderstanding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You cannot replace props on an existing object. So this creates a clone (with new onClick and onMouseMove props) and renders that clone instead. It doesn't render two <ol> elements.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, clever.

@macqueen
Copy link
Contributor

👍

@benvinegar benvinegar merged commit bf2e7a4 into master Jun 14, 2016
@mattrobenolt mattrobenolt deleted the strict-click branch June 20, 2016 21:34
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2020
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