score:1

Accepted answer
const testDecorator = (target: Function) => {
  const testMethod = () => 'successfully mixed testMethod into component';
  target.prototype.testMethod = testMethod;
};

interface TestDecorated {
  testMethod: () => any;
}

@testDecorator
export class TestClass extends React.Component<{}, {}> implements TestDecorated {
  //...       
  testMethod;

  render() {
    console.log('this.testMethod', this.testMethod());
    // outputs: "successfully mixed testMethod into component"
  }
}

Related Query

More Query from same tag