2022-07-07 08:50:36 +00:00
|
|
|
#![allow(non_snake_case)]
|
2023-01-06 23:00:12 +00:00
|
|
|
// import the prelude to get access to the `rsx!` macro and the `Scope` and `Element` types
|
2022-07-07 08:50:36 +00:00
|
|
|
use dioxus::prelude::*;
|
|
|
|
|
|
|
|
fn main() {
|
2023-01-06 23:00:12 +00:00
|
|
|
// launch the app in the terminal
|
2022-07-09 19:15:20 +00:00
|
|
|
dioxus_tui::launch(App);
|
2022-07-07 08:50:36 +00:00
|
|
|
}
|
|
|
|
|
2023-01-06 23:00:12 +00:00
|
|
|
// create a component that renders a div with the text "Hello, world!"
|
2022-07-07 08:50:36 +00:00
|
|
|
fn App(cx: Scope) -> Element {
|
|
|
|
cx.render(rsx! {
|
|
|
|
div {
|
2023-01-06 23:00:12 +00:00
|
|
|
"Hello, world!"
|
2022-07-07 08:50:36 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|