Not able to call function from React Js Button Click

class Message extends React.Component {
  constructor() {
    this.state = {
      message: "This is message",
  changeMessage = () => {
      message: "message changed",
  render = () => {
    return (
        <button onClick={this.changeMessage} color="success">
export default Message;

PS: Bhau, as you said you are new to React then I would highly recommend you Fullstack Open part1 – part4, an amazing resource, and very structured. It will probably take a week to complete and you will learn a lot more than typical Udemy or other tutorial series.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top