change rebuild_handler to rebuild_command

This commit is contained in:
Evan Almloff committed 2023-01-13 17:15:06 -06:00
1 parent 22f86ed464
commit 31e21aaa79
2 files changed
+14 -3

No files matched your search

+9
View File
@@ -97,6 +97,15 @@ fn main(){
}
```
To rebuild the application when the logic changes, you can use the `with_rebuild_command` function on the config builder. This command will be called when hot reloading fails to quickly update the rsx:
```rust
fn main(){
hot_reload_init!(Config::new().with_rebuild_command("cargo run"));
// launch your application
}
```
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 resulting strings.
You can then provide the Context to the builder to make hot reloading work with your custom namespace: