From 962709f42cf4b3c5223ac105175af3b17d1f45a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=B7=E6=B8=A1?= Date: Fri, 21 Mar 2025 12:48:22 +0800 Subject: [PATCH] docs: Change `render` function's return type (#27229) --- crates/gpui/docs/key_dispatch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/gpui/docs/key_dispatch.md b/crates/gpui/docs/key_dispatch.md index 5d3b1cac7e..ae7d828a4a 100644 --- a/crates/gpui/docs/key_dispatch.md +++ b/crates/gpui/docs/key_dispatch.md @@ -42,7 +42,7 @@ To bind actions, chain `on_action` on to your element: ```rust impl Render for Menu { - fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl Component { + fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { div() .on_action(|this: &mut Menu, move: &MoveUp, window: &mut Window, cx: &mut Context| { // ... @@ -59,7 +59,7 @@ In order to bind keys to actions, you need to declare a _key context_ for part o ```rust impl Render for Menu { - fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl Component { + fn render(&mut self, window: &mut Window, cx: &mut Context) -> impl IntoElement { div() .key_context("menu") .on_action(|this: &mut Menu, move: &MoveUp, window: &mut Window, cx: &mut Context| {