fix: change hooks name

This commit is contained in:
mrxiaozhuox committed 2022-02-01 08:39:31 +08:00
1 parent 7ca92be015
commit f1fe8f1d2a
2 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -34,7 +34,7 @@ impl DesktopContext {
/// ```rust
/// onmousedown: move |_| { desktop.drag_window(); }
/// ```
pub fn drag_window(&self) {
pub fn drag(&self) {
let _ = self.proxy.send_event(UserWindowEvent::DragWindow);
}
@@ -60,7 +60,7 @@ impl DesktopContext {
}
/// use this function can get the `DesktopContext` context.
pub fn use_desktop_context(cx: &ScopeState) -> &Rc<DesktopContext> {
pub fn use_window(cx: &ScopeState) -> &Rc<DesktopContext> {
cx.use_hook(|_| cx.consume_context::<DesktopContext>())
.as_ref()
.unwrap()