Skip to content

Commit

Permalink
Fix keyed playground
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav committed Jan 15, 2024
1 parent 675e39f commit eec21cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
28 changes: 13 additions & 15 deletions packages/keyed/dev/key.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Refs } from "@solid-primitives/refs";
import { splice, update } from "@solid-primitives/utils/immutable";
import { createSignal } from "solid-js";
import { createEffect, createSignal } from "solid-js";
import { Key } from "../src/index.js";
import { TransitionGroup } from "solid-transition-group";

Expand Down Expand Up @@ -78,26 +77,25 @@ export default function App() {
</div>
<div class="wrapper-h flex-wrap">
<TransitionGroup name="fade">
<Refs
onChange={({ added, removed }) =>
console.log("Added:", added.length, "| Removed:", removed.length)
}
<Key
each={list()}
by="id"
fallback={<p class="bg-yellow-500 p-1 transition-all">No items in the list.</p>}
>
<Key
each={list()}
by="id"
fallback={<p class="bg-yellow-500 p-1 transition-all">No items in the list.</p>}
>
{(item, index) => (
{(item, index) => {
createEffect(() => {
console.log("Effect:", item().id, item().value);
});
return (
<div class="node relative transition-all duration-500">
{index()}. {item().value}
<div class="bg-dark-500 text-light-900 absolute -bottom-2 left-2 px-1">
ID: {item().id}
</div>
</div>
)}
</Key>
</Refs>
);
}}
</Key>
</TransitionGroup>
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion site/src/entry-client.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { debounce } from "@solid-primitives/scheduled";
import { mount, StartClient } from "solid-start/entry-client";

import "solid-devtools";
// import "solid-devtools";

// Primitives/Table.tsx produces a lot of hydration warnings in development mode.
if (import.meta.env.MODE === "development") {
Expand Down

0 comments on commit eec21cf

Please sign in to comment.