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

[Fix] mount: do not mutate Component.contextTypes #1099

Merged
merged 1 commit into from
Aug 30, 2017

Conversation

ljharb
Copy link
Member

@ljharb ljharb commented Aug 30, 2017

Fixes #1091.

Turns out that this was only an issue on class-based components (possibly SFCs as well), presumably because createClass clones contextTypes for us.

Copy link
Collaborator

@aweary aweary left a comment

Choose a reason for hiding this comment

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

LGTM

describe('does not attempt to mutate Component.childContextTypes', () => {
const SimpleComponent = createClass({
displayName: 'Simple',
// contextTypes: Object.freeze({ b: PropTypes.string }),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be deleted or uncommented?

Copy link
Member Author

Choose a reason for hiding this comment

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

deleted, thanks

@ljharb ljharb force-pushed the fix_mount_contexttypes branch from 67e9397 to 10ee064 Compare August 30, 2017 21:24
@ljharb
Copy link
Member Author

ljharb commented Aug 30, 2017

(this bug originated in #171)

@ljharb ljharb merged commit aa8abc6 into enzymejs:master Aug 30, 2017
@ljharb ljharb deleted the fix_mount_contexttypes branch August 30, 2017 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants