wip: clean it up a bit

This commit is contained in:
Jonathan Kelley committed 2021-12-21 00:58:14 -05:00
1 parent b997b8ebbb
commit fa106be1f5
6 files changed
+59 -34

No files matched your search

+39
View File
@@ -4,6 +4,45 @@ This is the core crate for the Dioxus Virtual DOM. This README will focus on the
To build new apps with Dioxus or to extend the ecosystem with new hooks or components, use the higher-level `dioxus` crate with the appropriate feature flags.
```rust
fn app(cx: Scope<()>) -> Element {
cx.render(rsx!(
div { "hello world" }
))
}
fn main() {
let mut renderer = SomeRenderer::new();
// Creating a new virtualdom from a component
let mut dom = VirtualDom::new(app);
// Patching the renderer with the changes to draw the screen
let edits = dom.rebuild();
renderer.apply(edits);
// Injecting events
dom.handle_message(SchedulerMsg::UserEvent());
}
```
## Internals
Dioxus-core builds off the many frameworks that came before it. Notably, Dioxus borrows these concepts: