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

DraggableCore should be a PureComponent #301

Closed
gajus opened this issue Nov 18, 2017 · 3 comments
Closed

DraggableCore should be a PureComponent #301

gajus opened this issue Nov 18, 2017 · 3 comments

Comments

@gajus
Copy link

gajus commented Nov 18, 2017

Is there a reason why DraggableCore is not a PureComponent?

@STRML
Copy link
Collaborator

STRML commented Nov 18, 2017

We don't want to make any assumptions about your application, but most importantly:

PureComponent is counterproductive with components that use children. this.props.children !== this.props.children, essentially always, unless the developer has made an effort to hoist the child. If they're doing that, they can hoist the <Draggable /> as well.

Making this a PureComponent would only introduce a shallowCompare() that will always fail.

@STRML
Copy link
Collaborator

STRML commented Nov 18, 2017

See also facebook/react#8669.

@gajus gajus closed this as completed Nov 19, 2017
@gajus
Copy link
Author

gajus commented Nov 19, 2017

Makes sense.

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

No branches or pull requests

2 participants