Làm sao để tạo một event trong Reactjs?

{{FormatNumbertoThousand(model.total_like)}} lượt thích
6.718 lượt xem
Reactjs basic
class Display extends React.Component({    
    show(evt) {
        // code   
    },   
    render() {      
        // Render the div with an onClick prop (value is a function)        
        return (            
           <div onClick={this.show}>Click Me!</div>
         );    
    }
});

 

Một số chủ đề thú vị có thể bạn thích:

- Giới thiệu useState và useEffect-useRef trong React Hooks

{{login.error}}