Restore docs CI checks and fix all doc lints (#4204)
This commit is contained in:
1 parent
9027ffc278
commit
ee3b45af49
57 files changed
+120
-130
No files matched your search
@@ -62,7 +62,7 @@ impl VirtualDom {
|
||||
})
|
||||
}
|
||||
|
||||
/// Create a new [`ScopeState`] for a component that has been created with [`VirtualDom::create_scope`]
|
||||
/// Create a new [`Scope`](crate::scope_context::Scope) for a component.
|
||||
///
|
||||
/// Returns the number of nodes created on the stack
|
||||
#[tracing::instrument(skip(self, to), level = "trace", name = "VirtualDom::create_scope")]
|
||||
@@ -178,7 +178,7 @@ impl VNode {
|
||||
dom.remove_component_node(to, true, scope, Some(m));
|
||||
}
|
||||
|
||||
/// Create a new component (if it doesn't already exist) node and then mount the [`ScopeState`] for a component
|
||||
/// Create a new component (if it doesn't already exist) node and then mount the [`crate::ScopeState`] for a component
|
||||
///
|
||||
/// Returns the number of nodes created on the stack
|
||||
pub(super) fn create_component_node(
|
||||
|
||||
@@ -232,7 +232,7 @@ pub fn remove_future(id: Task) {
|
||||
///
|
||||
/// <div class="warning">
|
||||
///
|
||||
/// `use_hook` is not reactive. It just returns the value on every render. If you need state that will track changes, use [`use_signal`](dioxus::prelude::use_signal) instead.
|
||||
/// `use_hook` is not reactive. It just returns the value on every render. If you need state that will track changes, use [`use_signal`](https://docs.rs/dioxus-hooks/latest/dioxus_hooks/fn.use_signal.html) instead.
|
||||
///
|
||||
/// ❌ Don't use `use_hook` with `Rc<RefCell<T>>` for state. It will not update the UI and other hooks when the state changes.
|
||||
/// ```rust
|
||||
@@ -356,7 +356,7 @@ pub fn schedule_update_any() -> Arc<dyn Fn(ScopeId) + Send + Sync> {
|
||||
|
||||
/// Creates a callback that will be run before the component is removed.
|
||||
/// This can be used to clean up side effects from the component
|
||||
/// (created with [`use_effect`](dioxus::prelude::use_effect)).
|
||||
/// (created with [`use_effect`](https://docs.rs/dioxus-hooks/latest/dioxus_hooks/fn.use_effect.html)).
|
||||
///
|
||||
/// Note:
|
||||
/// Effects do not run on the server, but use_drop **DOES**. It runs any time the component is dropped including during SSR rendering on the server. If your clean up logic targets web, the logic has to be gated by a feature, see the below example for details.
|
||||
|
||||
@@ -341,11 +341,8 @@ type StaticTemplateAttributeArray = &'static [TemplateAttribute];
|
||||
/// A static layout of a UI tree that describes a set of dynamic and static nodes.
|
||||
///
|
||||
/// This is the core innovation in Dioxus. Most UIs are made of static nodes, yet participate in diffing like any
|
||||
/// dynamic node. This struct can be created at compile time. It promises that its name is unique, allow Dioxus to use
|
||||
/// dynamic node. This struct can be created at compile time. It promises that its pointer is unique, allow Dioxus to use
|
||||
/// its static description of the UI to skip immediately to the dynamic nodes during diffing.
|
||||
///
|
||||
/// For this to work properly, the [`Template::name`] *must* be unique across your entire project. This can be done via variety of
|
||||
/// ways, with the suggested approach being the unique code location (file, line, col, etc).
|
||||
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[derive(Debug, Clone, Copy, Eq, PartialOrd, Ord)]
|
||||
pub struct Template {
|
||||
|
||||
@@ -147,7 +147,7 @@ impl Scope {
|
||||
|
||||
/// Create a subscription that schedules a future render for the reference component
|
||||
///
|
||||
/// ## Notice: you should prefer using [`Self::schedule_update_any`] and [`Self::scope_id`]
|
||||
/// ## Notice: you should prefer using [`Self::schedule_update_any`] and [`Self::id`]
|
||||
pub fn schedule_update(&self) -> Arc<dyn Fn() + Send + Sync + 'static> {
|
||||
let (chan, id) = (self.sender(), self.id);
|
||||
Arc::new(move || drop(chan.unbounded_send(SchedulerMsg::Immediate(id))))
|
||||
@@ -155,7 +155,7 @@ impl Scope {
|
||||
|
||||
/// Schedule an update for any component given its [`ScopeId`].
|
||||
///
|
||||
/// A component's [`ScopeId`] can be obtained from `use_hook` or the [`current_scope_id`] method.
|
||||
/// A component's [`ScopeId`] can be obtained from `use_hook` or the [`current_scope_id`](crate::prelude::current_scope_id) method.
|
||||
///
|
||||
/// This method should be used when you want to schedule an update for a component
|
||||
pub fn schedule_update_any(&self) -> Arc<dyn Fn(ScopeId) + Send + Sync> {
|
||||
@@ -233,7 +233,7 @@ impl Scope {
|
||||
}
|
||||
}
|
||||
|
||||
/// Inject a Box<dyn Any> into the context of this scope
|
||||
/// Inject a `Box<dyn Any>` into the context of this scope
|
||||
pub(crate) fn provide_any_context(&self, mut value: Box<dyn Any>) {
|
||||
let mut contexts = self.shared_contexts.borrow_mut();
|
||||
|
||||
@@ -369,7 +369,7 @@ impl Scope {
|
||||
///
|
||||
/// <div class="warning">
|
||||
///
|
||||
/// `use_hook` is not reactive. It just returns the value on every render. If you need state that will track changes, use [`use_signal`](dioxus::prelude::use_signal) instead.
|
||||
/// `use_hook` is not reactive. It just returns the value on every render. If you need state that will track changes, use [`use_signal`](https://docs.rs/dioxus-hooks/latest/dioxus_hooks/fn.use_signal.html) instead.
|
||||
///
|
||||
/// ❌ Don't use `use_hook` with `Rc<RefCell<T>>` for state. It will not update the UI and other hooks when the state changes.
|
||||
/// ```rust
|
||||
@@ -605,7 +605,7 @@ impl ScopeId {
|
||||
.on_scope(self, f)
|
||||
}
|
||||
|
||||
/// Throw a [`CapturedError`] into a scope. The error will bubble up to the nearest [`ErrorBoundary`] or the root of the app.
|
||||
/// Throw a [`CapturedError`] into a scope. The error will bubble up to the nearest [`ErrorBoundary`](crate::prelude::ErrorBoundary) or the root of the app.
|
||||
///
|
||||
/// # Examples
|
||||
/// ```rust, no_run
|
||||
|
||||
@@ -33,7 +33,7 @@ impl std::fmt::Debug for ScopeId {
|
||||
}
|
||||
|
||||
impl ScopeId {
|
||||
/// The ScopeId of the main scope passed into [`VirtualDom::new`].
|
||||
/// The ScopeId of the main scope passed into [`crate::prelude::VirtualDom::new`].
|
||||
///
|
||||
/// This scope will last for the entire duration of your app, making it convenient for long-lived state
|
||||
/// that is created dynamically somewhere down the component tree.
|
||||
@@ -51,7 +51,7 @@ impl ScopeId {
|
||||
pub const APP: ScopeId = ScopeId(3);
|
||||
|
||||
/// The ScopeId of the topmost scope in the tree.
|
||||
/// This will be higher up in the tree than [`ScopeId::APP`] because dioxus inserts a default [`SuspenseBoundary`] and [`ErrorBoundary`] at the root of the tree.
|
||||
/// This will be higher up in the tree than [`ScopeId::APP`] because dioxus inserts a default [`crate::prelude::SuspenseBoundary`] and [`crate::prelude::ErrorBoundary`] at the root of the tree.
|
||||
// ScopeId(0) is the root scope wrapper
|
||||
pub const ROOT: ScopeId = ScopeId(0);
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ impl VirtualDom {
|
||||
dom
|
||||
}
|
||||
|
||||
/// Create a new VirtualDom from something that implements [`AnyProps`]
|
||||
/// Create a new VirtualDom from a VComponent
|
||||
#[instrument(skip(root), level = "trace", name = "VirtualDom::new")]
|
||||
pub(crate) fn new_with_component(root: VComponent) -> Self {
|
||||
let (tx, rx) = futures_channel::mpsc::unbounded();
|
||||
|
||||
Reference in new issue
Block a user