import * as React from 'react'; import './App.css'; import JqxButton from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxbuttons'; import JqxComplexInput from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxcomplexinput'; class App extends React.PureComponent<{}> { private myComplexInput = React.createRef(); constructor(props: {}) { super(props); this.getRealPart = this.getRealPart.bind(this); this.getImaginaryPart = this.getImaginaryPart.bind(this); } public render() { return (
Get real part Get imaginary part
); } private getRealPart(): void { const realPart = this.myComplexInput.current!.getReal(); alert(`Real part is ${realPart}`); } private getImaginaryPart(): void { const imaginaryPart = this.myComplexInput.current!.getImaginary(); alert(`Imaginary part is ${imaginaryPart}`); } } export default App;