wip: pass more events

This commit is contained in:
Jonathan Kelley committed 2022-11-15 16:37:23 -08:00
1 parent 47d0f51e00
commit 0dad91bc08
20 files changed
+773 -31

No files matched your search

+2 -2
View File
@@ -1,6 +1,6 @@
#![allow(non_snake_case)]
use dioxus::events::MouseEvent;
use dioxus::events::MouseData;
use dioxus::prelude::*;
fn main() {
@@ -20,7 +20,7 @@ fn App(cx: Scope) -> Element {
// ANCHOR: component_with_handler
#[derive(Props)]
pub struct FancyButtonProps<'a> {
on_click: EventHandler<'a, MouseEvent>,
on_click: EventHandler<'a, MouseData>,
}
pub fn FancyButton<'a>(cx: Scope<'a, FancyButtonProps<'a>>) -> Element<'a> {
+2 -2
View File
@@ -1,7 +1,7 @@
// ANCHOR: all
#![allow(non_snake_case)]
use dioxus::events::FormEvent;
use dioxus::events::FormData;
use dioxus::prelude::*;
fn main() {
@@ -83,7 +83,7 @@ fn Meme<'a>(cx: Scope<'a>, caption: &'a str) -> Element<'a> {
fn CaptionEditor<'a>(
cx: Scope<'a>,
caption: &'a str,
on_input: EventHandler<'a, FormEvent>,
on_input: EventHandler<'a, FormData>,
) -> Element<'a> {
let input_style = r"
border: none;
+2 -2
View File
@@ -1,7 +1,7 @@
// ANCHOR: all
#![allow(non_snake_case)]
use dioxus::events::FormEvent;
use dioxus::events::FormData;
use dioxus::prelude::*;
fn main() {
@@ -150,7 +150,7 @@ fn Meme<'a>(cx: Scope<'a>, caption: &'a str) -> Element<'a> {
fn CaptionEditor<'a>(
cx: Scope<'a>,
caption: &'a str,
on_input: EventHandler<'a, FormEvent>,
on_input: EventHandler<'a, FormData>,
) -> Element<'a> {
let is_dark_mode = use_is_dark_mode(&cx);