| 2 | import PropTypes from 'prop-types'; |
| 3 | |
| 4 | class HomeClass extends Component { |
| 5 | constructor(props) { |
| 6 | super(props); |
| 7 | this.state = { |
| 8 | College:'MKCE', |
| 9 | Department:'CSE' |
| 10 | } |
| 11 | } |
| 12 | changeDepartment= () => { |
| 13 | this.setState({Department:'AIML'}) |
| 14 | } |
| 15 | |
| 16 | |
| 17 | |
| 18 | render() { |
| 19 | return ( |
| 20 | <div> |
| 21 | <h4>College Name:{this.state.College}</h4> |
| 22 | <h4>Department Name:{this.state.Department}</h4> |
| 23 | <button onClick={this.changeDepartment}>Change Department</button> |
| 24 | |
| 25 | </div> |
| 26 | ); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | HomeClass.propTypes = { |
| 31 |
nothing calls this directly
no outgoing calls
no test coverage detected