Deprecate the component widget

This commit is contained in:
Héctor Ramón Jiménez 2024-09-05 15:08:08 +02:00
parent eada3b8bf2
commit 9426418adb
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 14 additions and 159 deletions

View file

@ -1,4 +1,5 @@
//! Build and reuse custom widgets using The Elm Architecture.
#![allow(deprecated)]
use crate::core::event;
use crate::core::layout::{self, Layout};
use crate::core::mouse;
@ -31,6 +32,11 @@ use std::rc::Rc;
/// Additionally, a [`Component`] is capable of producing a `Message` to notify
/// the parent application of any relevant interactions.
#[cfg(feature = "lazy")]
#[deprecated(
since = "0.13.0",
note = "components introduce encapsulated state and hamper the use of a single source of truth. \
Instead, leverage the Elm Architecture directly, or implement a custom widget"
)]
pub trait Component<Message, Theme = crate::Theme, Renderer = crate::Renderer> {
/// The internal state of this [`Component`].
type State: Default;