inertiax-svelte 2.4.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Render.svelte +18 -20
package/package.json
CHANGED
package/src/Render.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
1
|
+
<script module>
|
|
3
2
|
export const h = (component, props, children) => {
|
|
4
3
|
return {
|
|
5
4
|
component,
|
|
@@ -14,26 +13,25 @@
|
|
|
14
13
|
|
|
15
14
|
let {component: Component, props = {}, children = []} = $props()
|
|
16
15
|
|
|
17
|
-
let key = $state(new Date().getTime())
|
|
16
|
+
// let key = $state(new Date().getTime())
|
|
18
17
|
|
|
19
|
-
let prev = Component
|
|
18
|
+
// let prev = Component
|
|
20
19
|
|
|
21
|
-
function updateKey(Component) {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
// function updateKey(Component) {
|
|
21
|
+
// if (prev !== Component) {
|
|
22
|
+
// console.log('prev: ', prev)
|
|
23
|
+
// console.log('new: ', Component)
|
|
24
|
+
// prev = Component
|
|
25
|
+
// key = new Date().getTime()
|
|
26
|
+
// }
|
|
27
|
+
// }
|
|
27
28
|
|
|
28
|
-
$effect(() => updateKey(Component))
|
|
29
|
+
// $effect(() => updateKey(Component))
|
|
29
30
|
</script>
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</Component>
|
|
38
|
-
{/key}
|
|
39
|
-
{/if}
|
|
32
|
+
|
|
33
|
+
<Component {...props}>
|
|
34
|
+
{#each children as child, index (Component && Component.length === index ? $store.key : null)}
|
|
35
|
+
<svelte:self {...child} />
|
|
36
|
+
{/each}
|
|
37
|
+
</Component>
|