React 4

astia·2022년 6월 29일
0

React

목록 보기
4/13
<!DOCTYPE html>
<html>
<body>
    <div id="root"></div>
</body>
<script src="https://unpkg.com/react@17.0.2/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@17.0.2/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
    const root = document.getElementById("root");
    const Title = <h3 id="title" 
    onMouseEnter={() => console.log("mouse enter")}
    >
    Hello I'm a span
    </h3>
    
    const Button = <button 
    style={{backgroundColor:"tomato"}} 
    onClick={() => console.log("im clicked")}
    >
    누르시오
    </button>

    const container = React.createElement("div",null,[Title,Button]);
    ReactDOM.render(container,root);
</script>
</html>
profile
파이팅

0개의 댓글