Skip to content

Instantly share code, notes, and snippets.

@johnthepink
Created November 7, 2016 15:46
Show Gist options
  • Save johnthepink/2ddfb0f4bbfea6b8ce28cd8d56006d32 to your computer and use it in GitHub Desktop.
Save johnthepink/2ddfb0f4bbfea6b8ce28cd8d56006d32 to your computer and use it in GitHub Desktop.
// Removing Decorators
//
// Flow does not currently understand decorators. Also, removing the decorators
// sets us up to easily export things without data for testing.
// Current Pattern
@connect(mapStateToProps)
@withSavedPayments
export default class CheckoutButtons extends Component {
// things
}
// Removed Decorators
class CheckoutButtons extends Component {
// things
}
export default withSavedPayments(connect(mapStateToProps)(CheckoutButtons));
@delianides
Copy link

also

const SomethinWithData = connect(mapStateToProps)(SomethingComponent);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment