Struct dioxus_web::WebConfig
source · [−]pub struct WebConfig { /* private fields */ }Expand description
Configuration for the WebSys renderer for the Dioxus VirtualDOM.
This struct helps configure the specifics of hydration and render destination for WebSys.
Example
ⓘ
dioxus::web::launch(App, |cfg| cfg.hydrate(true).root_name("myroot"))Implementations
sourceimpl WebConfig
impl WebConfig
sourcepub fn hydrate(&mut self, f: bool) -> &mut Self
pub fn hydrate(&mut self, f: bool) -> &mut Self
Enable SSR hydration
This enables Dioxus to pick up work from a pre-renderd HTML file. Hydration will completely skip over any async work and suspended nodes.
Dioxus will load up all the elements with the dio_el data attribute into memory when the page is loaded.
sourcepub fn rootname(&mut self, name: impl Into<String>) -> &mut Self
pub fn rootname(&mut self, name: impl Into<String>) -> &mut Self
Set the name of the element that Dioxus will use as the root.
This is akint to calling React.render() on the element with the specified name.
sourcepub fn with_string_cache(&mut self, cache: Vec<String>) -> &mut Self
pub fn with_string_cache(&mut self, cache: Vec<String>) -> &mut Self
Set the name of the element that Dioxus will use as the root.
This is akint to calling React.render() on the element with the specified name.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for WebConfig
impl Send for WebConfig
impl Sync for WebConfig
impl Unpin for WebConfig
impl UnwindSafe for WebConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more