Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

i dont know why click event is not firing.can anyone help me please

enter image description here
can anyone solve thisenter image description here

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I checked your code and I fixed the problems:

import React, { Component } from 'react';

export default class Classcompo extends Component {
  constructor(props) {
    super(props);
    this.state = {
      message: 'welcome visitors',
    };
  }
  changeMessage() {
    this.setState({
      message: 'ok',
    });
  }
  render() {
    return (
      <div>
        <h1>{this.state.message}</h1>
        <button onClick={() => this.changeMessage()}>CLICK</button>
      </div>
    );
  }
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading