Skip to content

Commit dd8f62f

Browse files
rowanc1agoose77
andauthored
🚴‍♀️ Refactor task-item (#187)
Co-authored-by: Angus Hollands <goosey15@gmail.com>
1 parent 6e1a69a commit dd8f62f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/taskItem.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,14 @@ import { NodeRenderer } from '@myst-theme/providers';
33
import type { ListItem } from 'myst-spec-ext';
44
import { useTaskItemController } from './TaskItemControllerProvider';
55
import { MyST } from 'myst-to-react';
6-
import { GenericNode } from 'myst-common';
76

87
function TaskItem({
98
checked,
109
line,
1110
children
1211
}: {
1312
checked?: boolean;
14-
children: GenericNode[];
13+
children: React.ReactNode;
1514
line?: number;
1615
}) {
1716
// The rendering waiting on promises from Jupyter is slow
@@ -32,7 +31,7 @@ function TaskItem({
3231
setLocal(!local);
3332
}}
3433
/>
35-
<MyST ast={children} />
34+
{children}
3635
</li>
3736
);
3837
}
@@ -53,7 +52,7 @@ export const listItem: NodeRenderer<ListItem & { checked?: boolean }> = ({
5352
checked={node.checked}
5453
line={node.position?.start.line}
5554
>
56-
{node.children}
55+
<MyST ast={node.children} />
5756
</TaskItem>
5857
);
5958
};

0 commit comments

Comments
 (0)