Skip to content

Commit

Permalink
fix: use create_effect for <Portal/> to avoid hydration issues (c…
Browse files Browse the repository at this point in the history
…loses #2010) (#2029)
  • Loading branch information
gbj authored Nov 17, 2023
1 parent 68c91a7 commit 64b1e9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions leptos/src/portal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ pub fn Portal(
) -> impl IntoView {
cfg_if! { if #[cfg(all(target_arch = "wasm32", any(feature = "hydrate", feature = "csr")))] {
use leptos_dom::{document, Mountable};
use leptos_reactive::{create_render_effect, on_cleanup};
use leptos_reactive::{create_effect, on_cleanup};
use wasm_bindgen::JsCast;

let mount = mount
.unwrap_or_else(|| document().body().expect("body to exist").unchecked_into());

create_render_effect(move |_| {
create_effect(move |_| {
let tag = if is_svg { "g" } else { "div" };

let container = document()
Expand Down

0 comments on commit 64b1e9b

Please sign in to comment.