| 55 | export default App; |
| 56 | |
| 57 | class 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 | } |
| 69 | render(){ |
| 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( |
nothing calls this directly
no outgoing calls
no test coverage detected