Merge pull request #853 from Demonthos/fix-provide-context-docs

Fix the provide context docs
This commit is contained in:
Jon Kelley authored and GitHub committed 2023-02-27 15:04:49 -08:00
commit 49c5a5043a
1 file changed
+1 -6
+1 -6
View File
@@ -373,17 +373,12 @@ impl<'src> ScopeState {
None
}
/// Expose state to children further down the [`crate::VirtualDom`] Tree. Does not require `clone` on the context,
/// though we do recommend it.
/// Expose state to children further down the [`crate::VirtualDom`] Tree. Requires `Clone` on the context to allow getting values down the tree.
///
/// This is a "fundamental" operation and should only be called during initialization of a hook.
///
/// For a hook that provides the same functionality, use `use_provide_context` and `use_context` instead.
///
/// If a state is provided that already exists, the new value will not be inserted. Instead, this method will
/// return the existing value. This behavior is chosen so shared values do not need to be `Clone`. This particular
/// behavior might change in the future.
///
/// # Example
///
/// ```rust, ignore