ghost-portal/packages/react-components/src/TxComponent.tsx
Jaco Greeff ae3839a39f
Additional React.memo exports (#2456)
* Additional React.memo exports

* rm app-transfer artifacts
2020-03-25 12:30:19 +01:00

30 lines
724 B
TypeScript

// Copyright 2017-2020 @polkadot/react-components authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import React from 'react';
export default class TxComponent<P, S> extends React.PureComponent<P, S> {
protected button: any;
constructor (props: P) {
super(props);
this.button = React.createRef();
}
protected sendTx = (): void => {
const { component } = this.button.current;
if (component) {
component.current.send();
}
}
protected submit = (): void => {
if (this.button && this.button.current && this.button.current.click) {
this.button.current.click();
}
}
}