'How to call react function from console?

I want use consloe to call function like js, but consloe display "Uncaught ReferenceError: isDebug is not defined at :1:1".

SalesKpi.tsx

import * as React from 'react';
import styles from './SalesKpi.module.scss';
import './SalesKpi.css';
import { ISalesKpiProps } from './ISalesKpiProps';
import { escape } from '@microsoft/sp-lodash-subset';
import 'bootstrap/dist/css/bootstrap.css';
import $ from 'jquery';

export default class SalesKpi extends React.Component<ISalesKpiProps, {show: boolean;}> {
  public constructor(props) {
    super(props);
    this.state = {
       show: false
    }
   
  }
  public debug(){
    this.setState({show: true})
  }
  public render(): React.ReactElement<ISalesKpiProps> {
    return (
      <div className="row">
        {this.state.show &&
            <div className="col">
                .................
            </div>      
        }
      </div>
    )

}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source