forked from 4GeeksAcademy/react-tutorial-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.jsx
35 lines (31 loc) · 905 Bytes
/
app.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import React from "react";
import ReactDOM from "react-dom";
import PropTypes from "prop-types";
const Jumbotron = (props) => {
return (
//here you have to return expected html using the properties being passed to the component
<div className="jumbotron m-5">
<h1 className="display-4">{props.title}</h1>
<p className="lead">{props.description}</p>
<a className="btn btn-primary btn-lg" href={props.buttonURL} role="button">
{props.buttonLabel}
</a>
</div>
);
};
Jumbotron.propTypes = {
//proptypes here
title: PropTypes.string,
description: PropTypes.string,
buttonUrl: PropTypes.string,
buttonLabel: PropTypes.string,
};
ReactDOM.render(
<Jumbotron
title="Welcome to react"
description="React is the most popular rendering library in the world"
buttonLabel="Go to the official website"
buttonURL="https://reactjs.org/"
/>,
document.querySelector("#myDiv")
);