Hello, all! I read book from Kirupa.
It contains this code:
<! DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>React</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/[email protected]/babel.min.js"></script>
<style>
#container {
padding: 50px;
background-color: #FFF;
}
</style>
</head>
<body>
<div id="container"></div>
<script type="text/babel">
var destination = document.querySelector("#container");
class Letter extends React.Component {
render() {
var letterStyle = {
padding: 10,
margin: 10,
backgroundColor: "#FFDE00",
color: "#333",
display: "inline-block",
fontFamily: "monospace",
fontSize: 32,
textAlign: "center"
};
return(
<div>
{this.props.children}
</div>
);
}
}
ReactDOM.render(
<div>
<Letter>G</Letter>
<Letter>U</Letter>
<Letter>J</Letter>
<Letter>?</Letter>
<Letter>X</Letter>
</div>,
destination
);
</script>
</body>
</html>
I have wrong result
Why donβt letters have backgrond and others props of style?