About react

app.jsx
import React from "react";
import Header from "comp/header";
import Layout from "comp/layout";
import Footer from "comp/footer";
import {BrowserRouter as Router} from "react-router-dom"
import RouterView from "router"

import "common/css/bootstrap.min.css";
import "common/css/reset.css";
import "common/css/common.css";
import "common/css/style.css";

class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            show_footer : false
        }
        //this.showFooter = this.showFooter.bind(this)
        
    }
    showFooter(flag){
        this.setState({
            showFooter:flag
        })
    }
    render() {
        const { show_footer } = this.state;
        return <div className="wraper">
            <Header></Header>
            <Layout>
                this is enter page
                <Router>
                    <RouterView/>
                </Router>
            </Layout>
            <Footer flag={show_footer}></Footer>
        </div>
    }
}
export default App;
index.jsx
import React from "react";

class Footer extends React.componet{
    render(){
        const {flag = false} = this.props;
        return <footer className={flag?"footer":"footer hide"}>
            this is footer
        </footer>
    }
}
export default Footer;
directory

Jan.19,2022

try React.Component


Editor does not prompt completion? When you encounter a problem, locate yourself first.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4f4cd-43f99.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4f4cd-43f99.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?