Skip to content

Commit e8559dc

Browse files
jherrRyotaUshio
andauthored
Fix issues in Solid.js template (signal accessor not called, React-st… (#206)
Fix issues in Solid.js template (signal accessor not called, React-style loop instead of Solid <For>) Co-authored-by: RyotaUshio <[email protected]>
1 parent 4a541c0 commit e8559dc

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

frameworks/solid/add-ons/start/assets/src/routes/demo.start.server-funcs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function Home() {
4242
}}
4343
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"
4444
>
45-
Add 1 to {state}?
45+
Add 1 to {state()}?
4646
</button>
4747
</div>
4848
)

frameworks/solid/add-ons/start/assets/src/routes/index.tsx.ejs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createFileRoute } from "@tanstack/solid-router";
2+
import { For } from "solid-js"
23
<% if (!tailwind) { %>
34
import logo from "../logo.svg";
45
import "../App.css";
@@ -97,16 +98,17 @@ return (
9798
9899
<section class="py-16 px-6 max-w-7xl mx-auto">
99100
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
100-
{features.map((feature, index) => (
101-
<div
102-
key="{index}"
101+
<For each={features}>
102+
{(feature) => (
103+
<div
103104
class="bg-slate-800/50 backdrop-blur-sm border border-slate-700 rounded-xl p-6 hover:border-cyan-500/50 transition-all duration-300 hover:shadow-lg hover:shadow-cyan-500/10"
104105
>
105106
<div class="mb-4">{feature.icon}</div>
106107
<h3 class="text-xl font-semibold text-white mb-3">{feature.title}</h3>
107108
<p class="text-gray-400 leading-relaxed">{feature.description}</p>
108109
</div>
109-
))}
110+
)}
111+
</For>
110112
</div>
111113
</section>
112114
</div>

0 commit comments

Comments
 (0)