Skip to content

Commit

Permalink
fixed children props
Browse files Browse the repository at this point in the history
  • Loading branch information
donnikitos committed May 31, 2022
1 parent f28b2e6 commit 352aef9
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/no-jsx.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mutable, { mutableFn } from '@mutablejs/core';
import mutable, { mutableFn, processMaybeMutable } from '@mutablejs/core';
import mutableElement from '@mutablejs/dom';

// App root
Expand All @@ -11,13 +11,16 @@ const input = mutable<string>('');
// Render function
const children = mutableFn(({ todos: items }: { todos: string[] }) =>
items.map((item, i) =>
mutableElement('li', {
children: item,
style: 'cursor: no-drop; user-select: none;',
onclick: () => {
todos.value.splice(i, 1);
mutableElement(
'li',
{
style: 'cursor: no-drop; user-select: none;',
onclick: () => {
todos.value.splice(i, 1);
},
},
}),
item,
),
),
);

Expand Down Expand Up @@ -72,9 +75,7 @@ root?.append(
}
},
}),
mutableElement('button', {
children: 'Add todo',
}),
mutableElement('button', {}, 'Add todo'),
mutableElement('ul', {}, children({ todos })),
],
),
Expand Down

0 comments on commit 352aef9

Please sign in to comment.