How to add a hook to lifecycle after view!{} render out? #1561
Answered
by
gbj
tempbottle
asked this question in
Q&A
-
How to add a hook to lifecycle after view!{} render out in leptos? code like this:
|
Beta Was this translation helpful? Give feedback.
Answered by
gbj
Aug 27, 2023
Replies: 2 comments 2 replies
-
For what purpose do you want to do this? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Apologies, I missed this when you first posted it. I am assuming you mean that you want to run something on basically the tick after the component is rendered: #[component]
pub fn SomeComp() -> impl IntoView {
create_effect(|_| {
request_animation_frame(|| {
log!("view has rendered");
});
});
view! {
<div id="div_el_id"></div>
}
} Or do you mean something else by "after view render out"? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
tempbottle
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apologies, I missed this when you first posted it. I am assuming you mean that you want to run something on basically the tick after the component is rendered:
Or do you mean something else by "after view render out"?