Skip to content

Commit

Permalink
Removed duplicate comment block.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfrances107 committed Apr 15, 2024
1 parent 91510da commit 5fd1a28
Showing 1 changed file with 3 additions and 31 deletions.
34 changes: 3 additions & 31 deletions leptos_dom/src/node_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,12 @@ use leptos_reactive::{
};
use std::cell::Cell;

cfg_if::cfg_if!(
cfg_if::cfg_if!(
if #[cfg(debug_assertions)] {
/// Contains a shared reference to a DOM node created while using the `view`
/// macro to create your UI.
///
/// ```
/// # use leptos::{*, logging::log};
/// use leptos::html::Input;
///
/// #[component]
/// pub fn MyComponent() -> impl IntoView {
/// let input_ref = create_node_ref::<Input>();
///
/// let on_click = move |_| {
/// let node =
/// input_ref.get().expect("input_ref should be loaded by now");
/// // `node` is strongly typed
/// // it is dereferenced to an `HtmlInputElement` automatically
/// log!("value is {:?}", node.value())
/// };
///
/// view! {
/// <div>
/// // `node_ref` loads the input
/// <input _ref=input_ref type="text"/>
/// // the button consumes it
/// <button on:click=on_click>"Click me"</button>
/// </div>
/// }
/// }
/// ```
#[allow(missing_docs)]
pub struct NodeRef<T: ElementDescriptor + 'static> {
defined_at: &'static std::panic::Location<'static>,
element: RwSignal<Option<HtmlElement<T>>>,
defined_at: &'static std::panic::Location<'static>,
}
} else {
/// Contains a shared reference to a DOM node created while using the `view`
Expand Down

0 comments on commit 5fd1a28

Please sign in to comment.