بتل کد Battle Codeدارد باز می‌شود…

Find the Bugs چالش 6 از جلسه‌ی 2، سخت

این صفحه دو اشتباه دارد و اصلا اجرا نمی‌شود. هر دو را درست کن تا تیتر بشود Hello from Shiraz.
راهنمایی: یکی از تگ‌ها بسته نشده، و اسم شهر باید از متغیر city بیاید.

<style>
body { font-family: sans-serif; text-align: center; padding: 16px; }
button, input, select { font-size: 16px; min-height: 40px; margin: 4px; }
</style>

<div id="root" dir="ltr"></div>

<script type="text/jsx">
import { createRoot } from "react-dom/client";

function App() {
  const city = "Shiraz";
  return (
    <div>
      <h1 id="city">Hello from city</h1>
      <br>
      <p id="note">Nice to meet you</p>
    </div>
  );
}

createRoot(document.getElementById("root")).render(<App />);
</script>

راهنما و جواب این چالش · برگشت به درس جلسه‌ی 2: JSX و آکولاد

بیشتر بخوان: جاوااسکریپت چیست؟ از دکمه‌ی وب تا Node.js