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

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

صفحه‌ی خبر باید تیتر News و دو خط خبر را نشان بدهد، ولی دو اشتباه دارد و اجرا نمی‌شود. هر دو را درست کن.
راهنمایی: به حرف اول اسم‌ها نگاه کن.

<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 Title() {
  return <h1 id="title">News</h1>;
}

function story() {
  return <p>Rain tomorrow</p>;
}

function App() {
  return (
    <div>
      <title />
      <Story />
      <Story />
    </div>
  );
}

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

راهنما و جواب این چالش · برگشت به درس جلسه‌ی 3: قطعه داخل قطعه

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