gitlab

app.jsx

import React from 'react'

import MainTitle from './MainTitle.jsx'

import Footer from './components/Footer.jsx'

//import Header from './components/Header.js'

function App() {

    return (

        <div>

            {/*<Header />*/}

            <MainTitle pageTitle={"Promotion Treat"} />

            <Footer />

        </div>

    );

}


export default App


MainTitle.jsx

import React from "react";

import PropTypes from "prop-types"; // corrected


function MainTitle(props) {

    return (

        <header>

            <h1>{props.pageTitle}</h1>

            Bishal Mo:Mo Palace contact number: 984-1834588

        </header>

    );

}


MainTitle.propTypes = {

    pageTitle: PropTypes.string

};


export default MainTitle;

footer.jsx
import React from "react"
function Footer() {
    return (<header>
        One Month remaining by Sunil Shreshta
    </header>)
}

export default Footer

main.jsx


import React from 'react'

import ReactDOM from 'react-dom/client'

import App from './App.jsx'

import './index.css'



ReactDOM.createRoot(document.getElementById('root')).render(

    <React.StrictMode>        

        <App />        

  </React.StrictMode>,

)


index.html

<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite + React</title>
  </head>
  <body>
    <div id="root"></div>
    <script type="module" src="/src/main.jsx"></script>
  </body>
</html>

Comments