I am trying to get the Portfolio
class to utilize the this.prompt
method from the Title Bar
class. Despite extensive research, I have not been able to find a definitive solution for this yet.
Currently, my screen is just blank.
Below is the content of my index.html
file:
<!DOCTYPE html>
<html>
<head>
<title>name name</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="index.css">
<link rel="stylesheet" href="body.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.16/browser.js"></script>
</head>
<body>
<div id="firstBar"></div>
<div id="body"></div>
<div id="portfolio">
</div>
<script type="text/babel" src="index.js"></script>
<script type="text/babel" src="body.js"></script>
</body>
</html>
This is the code snippet in my index.js
file:
var TitleBar = React.createClass({
render: function() {
return(
<div className="jumbotron">
<div className="container">
<kbd className="fullName">name name</kbd>
<button onClick={this.prompt} type="button" className="btn btn-primary portfolio">Portfolio</button>
<button type="button" className="btn btn-primary about">About</button>
<button type="button" className="btn btn-primary contact">Contact</button>
</div>
</div>
);
}
});
ReactDOM.render(<TitleBar/>, document.getElementById('firstBar'));
var Portfolio = React.createClass({
this.props.prompt(
alert("hi");
);
render: function() {
return(
<p className="text-primary">Portfolio</p>
);
}
});
ReactDOM.render(<Portfolio prompt={this.prompt}/>, document.getElementById('portfolio'));