wip: rename fc to component
This commit is contained in:
1 parent
85ab8b91c6
commit
1e4a599d14
61 files changed
+524
-145
No files matched your search
+1
-1
@@ -11,7 +11,7 @@ async fn main() {
|
||||
dioxus::desktop::launch(App, |c| c);
|
||||
}
|
||||
|
||||
pub static App: FC<()> = |cx, _| {
|
||||
pub static App: Component<()> = |cx, _| {
|
||||
let count = use_state(cx, || 0);
|
||||
let mut direction = use_state(cx, || 1);
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ fn main() {
|
||||
dioxus::desktop::launch(APP, |cfg| cfg);
|
||||
}
|
||||
|
||||
const APP: FC<()> = |cx, _| {
|
||||
const APP: Component<()> = |cx, _| {
|
||||
let cur_val = use_state(cx, || 0.0_f64);
|
||||
let operator = use_state(cx, || None as Option<&'static str>);
|
||||
let display_value = use_state(cx, || String::from(""));
|
||||
|
||||
@@ -27,7 +27,7 @@ fn main() {
|
||||
|
||||
use dioxus::prelude::*;
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
let p1 = use_state(cx, || 0);
|
||||
let p2 = use_state(cx, || 0);
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ pub struct Client {
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, _| {
|
||||
static App: Component<()> = |cx, _| {
|
||||
let mut clients = use_ref(cx, || vec![] as Vec<Client>);
|
||||
let mut scene = use_state(cx, || Scene::ClientsList);
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ fn main() {
|
||||
});
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
let file_manager = use_ref(cx, || Files::new());
|
||||
let files = file_manager.read();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ impl Label {
|
||||
}
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, _props| {
|
||||
static App: Component<()> = |cx, _props| {
|
||||
let mut items = use_ref(cx, || vec![]);
|
||||
let mut selected = use_state(cx, || None);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ fn main() {
|
||||
dioxus::desktop::launch(App, |c| c.with_prerendered(content));
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
let mut val = use_state(cx, || 0);
|
||||
|
||||
cx.render(rsx! {
|
||||
|
||||
@@ -36,7 +36,7 @@ fn main() {
|
||||
dioxus_desktop::run(APP, (), |c| c.with_edits(edits));
|
||||
}
|
||||
|
||||
const APP: FC<()> = |(cx, _props)| {
|
||||
const APP: Component<()> = |(cx, _props)| {
|
||||
rsx!(cx, div {
|
||||
"some app"
|
||||
})
|
||||
|
||||
@@ -31,7 +31,7 @@ fn main() {
|
||||
});
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
let state = use_ref(cx, || Calculator::new());
|
||||
|
||||
let clear_display = state.read().display_value.eq("0");
|
||||
|
||||
@@ -11,7 +11,7 @@ fn main() {
|
||||
dioxus::desktop::launch(App, |c| c);
|
||||
}
|
||||
|
||||
pub static App: FC<()> = |cx, _| {
|
||||
pub static App: Component<()> = |cx, _| {
|
||||
let state = use_state(cx, PlayerState::new);
|
||||
|
||||
let is_playing = state.is_playing();
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ fn main() {
|
||||
dioxus::desktop::launch(App, |c| c);
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
let mut count = use_state(cx, || 0);
|
||||
|
||||
cx.render(rsx! {
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ pub enum Route {
|
||||
NotFound,
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
let route = use_router(cx, Route::parse)?;
|
||||
|
||||
cx.render(rsx! {
|
||||
|
||||
@@ -49,7 +49,7 @@ const NONE_ELEMENT: Option<()> = None;
|
||||
use baller::Baller;
|
||||
use dioxus::prelude::*;
|
||||
|
||||
pub static Example: FC<()> = |cx, props| {
|
||||
pub static Example: Component<()> = |cx, props| {
|
||||
let formatting = "formatting!";
|
||||
let formatting_tuple = ("a", "b");
|
||||
let lazy_fmt = format_args!("lazily formatted text");
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ fn main() {
|
||||
println!("{}", ssr::render_vdom(&vdom, |c| c));
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
cx.render(rsx!(
|
||||
div {
|
||||
h1 { "Title" }
|
||||
|
||||
@@ -14,7 +14,7 @@ fn main() {
|
||||
|
||||
const STYLE: &str = "body {overflow:hidden;}";
|
||||
|
||||
pub static App: FC<()> = |cx, props| {
|
||||
pub static App: Component<()> = |cx, props| {
|
||||
cx.render(rsx!(
|
||||
div { class: "overflow-hidden"
|
||||
style { "{STYLE}" }
|
||||
@@ -30,7 +30,7 @@ pub static App: FC<()> = |cx, props| {
|
||||
))
|
||||
};
|
||||
|
||||
pub static Header: FC<()> = |cx, props| {
|
||||
pub static Header: Component<()> = |cx, props| {
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
header { class: "text-gray-400 bg-gray-900 body-font"
|
||||
@@ -56,7 +56,7 @@ pub static Header: FC<()> = |cx, props| {
|
||||
})
|
||||
};
|
||||
|
||||
pub static Hero: FC<()> = |cx, props| {
|
||||
pub static Hero: Component<()> = |cx, props| {
|
||||
//
|
||||
cx.render(rsx! {
|
||||
section{ class: "text-gray-400 bg-gray-900 body-font"
|
||||
@@ -94,7 +94,7 @@ pub static Hero: FC<()> = |cx, props| {
|
||||
}
|
||||
})
|
||||
};
|
||||
pub static Entry: FC<()> = |cx, props| {
|
||||
pub static Entry: Component<()> = |cx, props| {
|
||||
//
|
||||
cx.render(rsx! {
|
||||
section{ class: "text-gray-400 bg-gray-900 body-font"
|
||||
@@ -107,7 +107,7 @@ pub static Entry: FC<()> = |cx, props| {
|
||||
})
|
||||
};
|
||||
|
||||
pub static StacksIcon: FC<()> = |cx, props| {
|
||||
pub static StacksIcon: Component<()> = |cx, props| {
|
||||
cx.render(rsx!(
|
||||
svg {
|
||||
// xmlns: "http://www.w3.org/2000/svg"
|
||||
@@ -122,7 +122,7 @@ pub static StacksIcon: FC<()> = |cx, props| {
|
||||
}
|
||||
))
|
||||
};
|
||||
pub static RightArrowIcon: FC<()> = |cx, props| {
|
||||
pub static RightArrowIcon: Component<()> = |cx, props| {
|
||||
cx.render(rsx!(
|
||||
svg {
|
||||
fill: "none"
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ fn main() {
|
||||
dioxus::desktop::launch(App, |c| c);
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
let mut count = use_state(cx, || 0);
|
||||
|
||||
cx.push_task(async move {
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ pub struct TodoItem {
|
||||
}
|
||||
|
||||
const STYLE: &str = include_str!("./assets/todomvc.css");
|
||||
const App: FC<()> = |cx, props| {
|
||||
const App: Component<()> = |cx, props| {
|
||||
let mut draft = use_state(cx, || "".to_string());
|
||||
let mut todos = use_state(cx, || HashMap::<u32, Rc<TodoItem>>::new());
|
||||
let mut filter = use_state(cx, || FilterState::All);
|
||||
|
||||
@@ -12,7 +12,7 @@ fn main() {
|
||||
|
||||
const ENDPOINT: &str = "https://api.openweathermap.org/data/2.5/weather";
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
//
|
||||
let body = use_suspense(
|
||||
cx,
|
||||
@@ -40,7 +40,7 @@ static App: FC<()> = |cx, props| {
|
||||
#[derive(PartialEq, Props)]
|
||||
struct WeatherProps {}
|
||||
|
||||
static WeatherDisplay: FC<WeatherProps> = |cx, props| {
|
||||
static WeatherDisplay: Component<WeatherProps> = |cx, props| {
|
||||
//
|
||||
cx.render(rsx!(
|
||||
div { class: "flex items-center justify-center flex-col"
|
||||
|
||||
@@ -19,7 +19,7 @@ fn main() {
|
||||
dioxus::web::launch(App, |c| c);
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
let mut rng = SmallRng::from_entropy();
|
||||
let rows = (0..1_000).map(|f| {
|
||||
let label = Label::new(&mut rng);
|
||||
|
||||
@@ -16,7 +16,7 @@ fn main() {
|
||||
dioxus::web::launch(App, |c| c);
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx, props| {
|
||||
static App: Component<()> = |cx, props| {
|
||||
let mut count = use_state(cx, || 0);
|
||||
|
||||
cx.render(rsx! {
|
||||
|
||||
Reference in new issue
Block a user