File tree Expand file tree Collapse file tree 3 files changed +50
-2
lines changed Expand file tree Collapse file tree 3 files changed +50
-2
lines changed Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+ import ReactDOM from "react-dom" ;
3
+ import PropTypes from "prop-types" ;
4
+
5
+ const Jumbotron = props => {
6
+ //here you have to return expected html using the properties being passed to the component
7
+ } ;
8
+
9
+ Jumbotron . propTypes = {
10
+ //proptypes here
11
+ title : PropTypes . string ,
12
+
13
+ } ;
14
+
15
+ ReactDOM . render (
16
+ < Jumbotron
17
+ title = "Welcome to react"
18
+ description = "React is the most popular rendering library in the world"
19
+ buttonLabel = "Go to the official website"
20
+ buttonURL = "https://reactjs.org/"
21
+ /> ,
22
+
23
+ document . querySelector ( "#myDiv" )
24
+ ) ;
Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+ import ReactDOM from "react-dom" ;
3
+ import PropTypes from "prop-types" ;
4
+
5
+ /**
6
+ * here you have declare your Alert component and return
7
+ * the html that bootstrap dictates for its alert component
8
+ */
9
+
10
+
11
+ // here is where the alert component is being used, you don't have to edit this part,
12
+ // but it helps you understan what properties is the component using
13
+ ReactDOM . render ( < Alert text = "OMG! Something really bad has happended!" /> , document . querySelector ( "#myDiv" ) ) ;
Original file line number Diff line number Diff line change @@ -2,14 +2,25 @@ import React from "react";
2
2
import ReactDOM from "react-dom" ;
3
3
import PropTypes from "prop-types" ;
4
4
5
- const Jumbotron = props => {
5
+ const Jumbotron = ( props ) => {
6
6
//here you have to return expected html using the properties being passed to the component
7
+
8
+ return ( < div className = "jumbotron m-5" >
9
+ < h1 className = "display-4" > { props . title } </ h1 >
10
+ < p className = "lead" > { props . description } </ p >
11
+ < a className = "btn btn-primary btn-lg" href = { props . buttonURL } role = "button" >
12
+ { props . buttonLabel }
13
+ </ a >
14
+ </ div >
15
+ )
7
16
} ;
8
17
9
18
Jumbotron . propTypes = {
10
19
//proptypes here
11
20
title : PropTypes . string ,
12
-
21
+ description : PropTypes . string ,
22
+ buttonLabel : PropTypes . string ,
23
+ buttonURL : PropTypes . string ,
13
24
} ;
14
25
15
26
ReactDOM . render (
You can’t perform that action at this time.
0 commit comments