feat: upgrade syntax
This commit is contained in:
1 parent
574d7fdb9e
commit
fd93ee89c1
64 files changed
+522
-437
No files matched your search
@@ -1,7 +1,7 @@
|
||||
use dioxus::prelude::*;
|
||||
fn main() {}
|
||||
|
||||
pub static Example: FC<()> = |(cx, props)| {
|
||||
pub static Example: FC<()> = |cx, props| {
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
|
||||
@@ -10,7 +10,7 @@ pub static Example: FC<()> = |(cx, props)| {
|
||||
};
|
||||
|
||||
// A controlled component:
|
||||
static ControlledSelect: FC<()> = |(cx, props)| {
|
||||
static ControlledSelect: FC<()> = |cx, props| {
|
||||
let value = use_state(cx, || String::from("Grapefruit"));
|
||||
cx.render(rsx! {
|
||||
select { value: "{value}", onchange: move |evt| value.set(evt.value()),
|
||||
@@ -23,7 +23,7 @@ static ControlledSelect: FC<()> = |(cx, props)| {
|
||||
};
|
||||
|
||||
// TODO - how do uncontrolled things work?
|
||||
static UncontrolledSelect: FC<()> = |(cx, props)| {
|
||||
static UncontrolledSelect: FC<()> = |cx, props| {
|
||||
let value = use_state(cx, || String::new());
|
||||
|
||||
cx.render(rsx! {
|
||||
|
||||
Reference in new issue
Block a user