pub struct Config { /* private fields */ }Expand description
Implementations§
Source§impl Config
impl Config
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new Default instance of the Config.
This is no different than calling Config::default()
Sourcepub fn rootname(self, name: impl Into<String>) -> Self
pub fn rootname(self, name: impl Into<String>) -> Self
Set the name of the element that Dioxus will use as the root.
This is akin to calling React.render() on the element with the specified name.
Note that this only works on the current document, i.e. window.document.
To use a different document (popup, iframe, …) use Self::rootelement instead.
Sourcepub fn rootelement(self, elem: Element) -> Self
pub fn rootelement(self, elem: Element) -> Self
Set the element that Dioxus will use as root.
This is akin to calling React.render() on the given element.
Sourcepub fn rootnode(self, node: Node) -> Self
pub fn rootnode(self, node: Node) -> Self
Set the node that Dioxus will use as root.
This is akin to calling React.render() on the given element.
Sourcepub fn history(self, history: Rc<dyn History>) -> Self
pub fn history(self, history: Rc<dyn History>) -> Self
Set the history provider for the application.
dioxus-web provides two history providers:
dioxus_history::WebHistory: A history provider that uses the browser history API.dioxus_history::HashHistory: A history provider that uses the#url fragment.
By default, dioxus-web uses the WebHistory provider, but this method can be used to configure
a different history provider.