SolidJSS
SolidJSโ€ข3y agoโ€ข
6 replies
Sparrow

For component not displaying values

What am I doing wrong here??

import { For } from "solid-js";

const ratings = [1, 2, 3, 4, 5];

export default function Ratings() {
   return (
      <form action="thank-you.html">
        <For each={ratings}>
        {(rate) => {
        <div>
        <input type="radio" name="rating" id={rate} />
        <label for={rate}>{rate}</label>
         </div>;
         }}
    </For>
      </form>
    );
}
Was this page helpful?