Skip to content

[Core] remove context-pure mixin from components #2837

@yongxu

Description

@yongxu

This mixin appears in many components, checking if context.muiTheme has changed.

First of all, I do not see why this component is necessary besides supporting dynamic theme. This can be done by creating a new theme context instance, React will then tell it has been changed.

Moreover, Its appearance may significantly affect the performance since it does checking in shouldComponentUpdate every time react does reconciliation. Especially, this happens for every flat button and text field.

Last, but may not relate to this issue, context-pure mixin uses src/utils/shallow-equal.js, the same function has been implemented as react addon react-addons-shallow-compare. I think we should remove it from utils.

Here is the sublime search result:

Edit by @newoga (replaced @yongxu sublime search results with checklist)

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceumbrellaFor grouping multiple issues to provide a holistic view

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions