1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

React で jsx を使うサンプル (その 2)

Last updated at Posted at 2022-03-02

こちらと同様のサンプルです。
React で jsx を使うサンプル

index.html
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>React Elements</title>
</head>
<body>

<div id="app"></div>

<br />
Mar/02/2022<br />
<script src="https://unpkg.com/react@18/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel">
console.log("*** start ***")
const mm_aa = React.createElement("h1", null, "おはようございます。")
const mm_bb = React.createElement("div", null, "こんにちは。")

const mm_cc = <blockquote><div>今晩は</div></blockquote>
const mm_dd = <div>Test</div>

const app = document.getElementById('app')
const root = ReactDOM.createRoot(app)
root.render([mm_aa,mm_bb,mm_cc,mm_dd])

console.log("*** end ***")
</script>
</body>
</html>

react_mar02.png

1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?