Guest User

Untitled

a guest
Dec 11th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import React from 'react';
  2.  
  3. const withPure = <P extends any>(
  4. WrappedComponent: React.ComponentType<P>,
  5. ): React.ComponentClass<P> => {
  6. class Purified extends React.PureComponent<P> {
  7. render() {
  8. return <WrappedComponent {...this.props} />;
  9. }
  10. }
  11.  
  12. return Purified;
  13. };
  14.  
  15. export default withPure;
Add Comment
Please, Sign In to add comment