<!DOCTYPE html><!-- https://prnt.sc/wZ62HZV8cI-A -->
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Stan komponentu</title>
<script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<style>
#container{
padding: 50px;
background-color: #fff;
}
</style>
</head>
<body>
<div id="container"></div>
<script type="text/babel">
class Circle extends React.Component {
render(){
var circleStyle={
padding: 10,
margin: 20,
display: "inline-block",
backgroundColor: this.props.bgColor,
borderRadius: "50%",
width: 100,
height: 100,
};
return(<div style={circleStyle}> </div>);
}
}
ReactDOM.render(<div>
<Circle bgColor="blue" />
</div>,
document.getElementById("container")
);
</script>
</body>
</html>
Paste Hosted With By Wklejamy.pl