Skip to content

Commit a80987f

Browse files
committed
fixed example
1 parent 659f371 commit a80987f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

examples/custom_renderers_svg/src/renderers.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,16 @@ where
9696
}
9797

9898
#[component]
99-
pub fn SvgTextCellRenderer<T>(
99+
#[allow(unused_variables)]
100+
pub fn SvgTextCellRenderer<T, F>(
100101
#[prop(into)] class: MaybeSignal<String>,
101102
#[prop(into)] value: MaybeSignal<T>,
103+
on_change: F,
102104
index: usize,
103105
) -> impl IntoView
104106
where
105107
T: IntoView + Clone + 'static,
108+
F: Fn(String) + 'static,
106109
{
107110
let x = x_from_index(index);
108111

@@ -112,11 +115,16 @@ where
112115
}
113116

114117
#[component]
115-
pub fn SvgPathCellRenderer(
118+
#[allow(unused_variables)]
119+
pub fn SvgPathCellRenderer<F>(
116120
#[prop(into)] class: MaybeSignal<String>,
117121
#[prop(into)] value: MaybeSignal<String>,
122+
on_change: F,
118123
index: usize,
119-
) -> impl IntoView {
124+
) -> impl IntoView
125+
where
126+
F: Fn(String) + 'static,
127+
{
120128
let transform = transform_from_index(index, 3);
121129

122130
view! {

0 commit comments

Comments
 (0)