Skip to content

Commit

Permalink
Remove map and createStore from mount.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
thetarnav authored Oct 8, 2024
1 parent 179500f commit 680940d
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/start/src/client/mount.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { JSX } from "solid-js";
import { createStore } from "solid-js/store";
import {
createComponent,
getHydrationKey,
Expand All @@ -14,7 +13,6 @@ import {
*/
export function mount(fn: () => JSX.Element, el: MountableElement) {
if (import.meta.env.START_ISLANDS) {
const map = new WeakMap();
async function mountIsland(el: HTMLElement) {
if (el.dataset.css) {
let css = JSON.parse(el.dataset.css);
Expand All @@ -39,7 +37,7 @@ export function mount(fn: () => JSX.Element, el: MountableElement) {
let hk = el.dataset.hk;
// _$DEBUG("hydrating island", el.dataset.island, hk.slice(0, hk.length - 1) + `1-`, el);

let props = createStore({
let props = {
...JSON.parse(el.dataset.props!),
get children() {
const p = el.getElementsByTagName("solid-children");
Expand All @@ -49,11 +47,9 @@ export function mount(fn: () => JSX.Element, el: MountableElement) {
});
return;
}
});

map.set(el, props);
};

hydrate(() => createComponent(Component, props[0]), el, {
hydrate(() => createComponent(Component, props), el, {
renderId: hk.slice(0, hk.length - 1) + `${1 + Number(el.dataset.offset)}-`,
owner: lookupOwner(el)
});
Expand Down

0 comments on commit 680940d

Please sign in to comment.