MCPcopy Create free account
hub / github.com/codemistic/Web-Development / Clockclass

Class Clockclass

alarm/src/App.js:57–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55export default App;
56
57class Clockclass extends React.Component{
58 constructor(props){
59 super(props)
60
61 this.state={date:new Date()};
62 }
63 componentDidMount(){
64 this.timerID=setInterval(()=>(this.setState({date:new Date()})),1000)
65 }
66 componentWillUnmount(){
67 clearInterval (this.timerID)
68 }
69render(){
70 return (<>
71 <div>
72 <h2>{this.state.date.toLocaleTimeString()}<br/>{this.state.date.toLocaleDateString()}<br/></h2>
73 </div> <InputTimer></InputTimer></>
74 );
75 }}
76 function App(){
77
78 return(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected