Sparrow
Sparrow
Explore posts from servers
SSolidJS
Created by Sparrow on 3/18/2023 in #support
Pass data from Express up to Solid
I have already install and run npm run build, How can I pass data from express to solid just as how I would do it for EJS or Handlebars???
5 replies
SSolidJS
Created by Sparrow on 1/28/2023 in #support
I get `Invalid left-hand side in assignment expression.` when I assign a value.
I get the error above if I try to assign a value to selectedRate inside the onClick even with the arrow function removed, I still get an error.
const ratings = [1, 2, 3, 4, 5];

export default function Ratings() {
const [selectedRate, setSelectedRate] = createSignal(0);

return (
<form action="thank-you.html">
<ul class="rating-numbers flex">
<For each={ratings}>
{(rate) => <li onClick={() => setSelectedRate(selectedRate() = rate)}>{rate}</li>}
</For>
</ul>
</form>
// ...
const ratings = [1, 2, 3, 4, 5];

export default function Ratings() {
const [selectedRate, setSelectedRate] = createSignal(0);

return (
<form action="thank-you.html">
<ul class="rating-numbers flex">
<For each={ratings}>
{(rate) => <li onClick={() => setSelectedRate(selectedRate() = rate)}>{rate}</li>}
</For>
</ul>
</form>
// ...
2 replies
SSolidJS
Created by Sparrow on 1/28/2023 in #support
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>
);
}
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>
);
}
7 replies