1useEffect(() => {
2 const timer = setTimeout(() => {
3 console.log('This will run after 1 second!')
4 }, 1000);
5 return () => clearTimeout(timer);
6}, []);
1
2
3import React, {Component} from 'react';
4
5import Router_App from './Router';
6import "./App.css";
7
8
9class App extends Component {
10 constructor(props){
11 super(props);
12 this.state = {
13 timePassed: false
14 };
15 }
16
17 render() {
18 setTimeout(() => {this.setState({timePassed: true})}, 1700);
19 if (!this.state.timePassed){
20 return (
21 <div style={{textAlign:"center",marginTop:"15%",fontSize:"5.5rem"}}>
22 <p>M E A N I N G <br/>O F<br/> C O D E</p>
23 </div>
24 );
25 }else{
26
27 return (
28 <Router_App/>
29 );
30 }
31 }
32}
33export default App;