tonyhb / redux-ui

Easy UI state management for react redux
636 stars 58 forks source link

Avoid binding in render #46

Open gcazaciuc opened 8 years ago

gcazaciuc commented 8 years ago

The render code in ui.js uses the binding operator to pass updateUI and resetUI to the underlying component. This creates new functions at each render pass since behind the scenes it is compiled to this.updateUI.bind(this) and this.resetUI.bind(this) leading to 2 issues:

  1. It cancels out shallowEqual/pure render mixin from any subcomponents they are passed to as props
  2. It needlesly creates new functions at each render pass.