0% found this document useful (0 votes)
8 views

EXERCISE 7

Uploaded by

petchithai10
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

EXERCISE 7

Uploaded by

petchithai10
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

EXERCISE7:

About.js

import React from 'react';

function About(){

return <div>

<h2>DR.SACOE is an engineering college situated in Tiruchendur and was established in


1995</h2>

read more about us at:<a href="http://www.drsacoe.org">http://www.drsacoe.org</a>

</div>

export default About;

Contact.js:

import React from "react";

function Contact(){

return <address>

you can find us here:<br/>

DR.SACOE<br/>

Palayamkottai road,Tiruchendur<br/>

Tuticorin dist,Tamilnadu 628215<br/>

Phone:+914689247898<br/>

</address>

export default Contact;


home.js

import React from 'react';

function Home(){

return <h1>welcome to DR.SACOE</h1>

export default Home;

React.js

import React,{component} from 'react';

import {BrowserRouter as Router,Routes,Route,Link}from 'react-router-dom';

import Home from './component/home';

import About from './component/about';

import Contact from './component/contact';

import './App.css';

class App extends component{

render(){

return(

<Router>

<div className="App">

<ul className="App-header">

<li>

<Link to="/">Home</Link>

</li>
<li>

<Link to="/">About Us</Link>

</li>

<li>

<Link to="/">Contact Us</Link>

</li>

</ul>

<Routes>

<Route exact path='/'element={<Home/>}></Route>

<Route exact path='/'about={<About/>}></Route>

<Route exact path='/'contact={<Contact/>}></Route>

</Routes>

</div>

</Router>

);

export default App;

You might also like