MCPcopy Create free account
hub / github.com/ARTHIJS/Reactjs / HomeClass

Class HomeClass

HomeClass.js:4–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import PropTypes from 'prop-types';
3
4class 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
30HomeClass.propTypes = {
31

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected