-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
37 lines (37 loc) · 1.03 KB
/
Copy pathindex.html
File metadata and controls
37 lines (37 loc) · 1.03 KB
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
36
37
<!DOCTYPE html>
<html>
<body>
<div id="root"></div>
</body>
<script src="https://unpkg.com/react@17.0.2/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/prop-types@15.7.2/prop-types.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
const Btn = ({ text, fontSize = 12 }) => {
return <button
style={{
backgroundColor:'tomato',
color:'white',
padding:'10px 20px',
border: 0,
borderRadius: 10,
fontSize,
}}>{text}</button>
}
Btn.propTypes = {
text: PropTypes.string.isRequired,
fontSize: PropTypes.number,
}
const App = () => {
return(
<div>
<Btn text="Save Changes" fontSize={18} />
<Btn text={"Continue"} />
</div>
)
};
const root = document.getElementById("root");
ReactDOM.render(<App />, root);
</script>
</html>