Skip to content

Instantly share code, notes, and snippets.

@ross-u
Last active July 18, 2021 15:55
Show Gist options
  • Save ross-u/2b5b1832bad24c0207bd1dc7e443239c to your computer and use it in GitHub Desktop.
Save ross-u/2b5b1832bad24c0207bd1dc7e443239c to your computer and use it in GitHub Desktop.
m3 react routing intro starter code
import React from 'react'
function AboutPage() {
return (
<div>
<h1>About</h1>
<img src="https://media.giphy.com/media/dWkyPssovVa6Y/giphy.gif" alt="the-office-gif" width="800px" height="auto"/>
</div>
)
}
export default AboutPage;
import React from 'react'
function ErrorPage() {
return (
<div>
<h1>404</h1>
<img
src="https://media.giphy.com/media/8L0Pky6C83SzkzU55a/giphy.gif"
alt="404-error-gif"
width="800px"
height="auto"
/>
</div>
)
}
export default ErrorPage;
import React, { Component } from 'react'
class HomePage extends Component {
render() {
return (
<div>
<h1>Home</h1>
<img src="https://media.giphy.com/media/3oKIPEqDGUULpEU0aQ/giphy.gif" alt="dashboard-gif"/>
</div>
)
}
}
export default HomePage;
import { useState } from "react";
function Projects() {
const [projects, setProjects] = useState([]);
return (
<div>
<h2>Projects</h2>
{projects.map((project) => {
return (
<div key={project.id} className="project">
<h3>{project.name}</h3>
<p>{project.technologies}</p>
</div>
);
})}
</div>
);
}
export default Projects;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment