Closed danielnehrig closed 2 years ago
The published version shouldn't need the sycamore patch anymore. Can you try removing that line and also run cargo update
?
Ok this works but now im running into lifetime issues
#[perseus::template_rx]
pub fn article_page<'a, G: Html>(
cx: Scope<'a>,
ArticlePageStateRx { article }: ArticlePageStateRx<'a>,
) -> View<G> {
let content = article.get().content.clone();
let parsed = parse::<()>(content.as_str()).unwrap();
view! { cx,
PageWrapper {
NavBar(is_admin = false) {
div() {}
}
// div() {(entry.title)}
MDSycX(body=parsed.body)
}
}
}
error[E0597]: `content` does not live long enough
--> src/templates/article.rs:20:30
|
15 | pub fn article_page<'a, G: Html>(
| -- lifetime `'a` defined here
...
20 | let parsed = parse::<()>(content.as_str()).unwrap();
| ^^^^^^^^^^^^^^^^ borrowed value does not live long enough
21 |
22 | / view! { cx,
23 | | PageWrapper {
24 | | NavBar(is_admin = false) {
25 | | div() {}
... |
29 | | }
30 | | }
| |_____- argument requires that `content` is borrowed for `'a`
31 | }
| - `content` dropped here while still borrowed
For more information about this error, try `rustc --explain E0597`.
warning: `dn` (lib) generated 5 warnings
error: could not compile `dn` due to previous error; 5 warnings emitted
Try create_ref(cx, content)
instead. The lifetime needs to last as long as the reactive scope.
well problem was my lack of knowledge about sycamore sorry about that and thanks for helping me out i've got it working !
i'm still facing the same issue :/ maybe you have an idea
my cargo toml
cargo check --target wasm32-unknown-unknown