allow custom namespaces

This commit is contained in:
Evan Almloff committed 2023-01-12 10:52:24 -06:00
1 parent c49c59b8b2
commit 351b9fab6f
5 files changed
+41 -13

No files matched your search

+11
View File
@@ -97,6 +97,17 @@ fn main(){
}
```
If you are using a namespace other than html, you can implement the [HotReloadingContext](https://docs.rs/dioxus-rsx/latest/dioxus_rsx/trait.HotReloadingContext.html) trait to provide a mapping between the rust names of your elements/attributes and the resultsing strings.
You can then provide the Context to the macro to make hot reloading work with your custom namespace:
```rust
fn main(){
hot_reload_init!(@MyNamespace /*more configeration*/);
// launch your application
}
```
## Implementing hot reloading for a custom renderer
To add hot reloading support to your custom renderer you can use the connect function. This will connect to the dev server you just need to provide a way to transfer `Template`s to the `VirtualDom`. Once you implement this your users can use the hot_reload_init function just like any other render.