Skip to content

Commit 201b0eb

Browse files
committed
Revert "Generic H::(ref_container|ref-callback)()"
This reverts commit c5a0432.
1 parent c5a0432 commit 201b0eb

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

src/props/h.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use super::Props;
22
use crate::{
3-
callback::PersistedCallback, create_element, hooks::JsRefContainer, KeyType,
4-
VNode, VNodeList,
3+
callback::PersistedCallback, create_element, hooks::JsRefContainer, VNode,
4+
VNodeList, KeyType,
55
};
6-
use std::{borrow::Cow, ops::Deref};
6+
use std::borrow::Cow;
77
use wasm_bindgen::{
8-
convert::{FromWasmAbi, IntoWasmAbi, OptionFromWasmAbi},
8+
convert::{FromWasmAbi, IntoWasmAbi},
99
JsValue,
1010
};
1111
use web_sys::Element;
@@ -67,24 +67,21 @@ impl<T: HType> H<T> {
6767
/// [`use_js_ref()`](crate::hooks::use_js_ref()) hook.
6868
///
6969
/// [ref]: https://reactjs.org/docs/refs-and-the-dom.html
70-
pub fn ref_container<E>(mut self, ref_container: &JsRefContainer<E>) -> Self
71-
where
72-
E: Deref<Target = Element>,
73-
{
70+
pub fn ref_container(
71+
mut self,
72+
ref_container: &JsRefContainer<Element>,
73+
) -> Self {
7474
self.props = self.props.ref_container(ref_container);
7575
self
7676
}
7777

7878
/// Sets the [React ref][ref] to the given ref callback.
7979
///
8080
/// [ref]: https://reactjs.org/docs/refs-and-the-dom.html
81-
pub fn ref_callback<E>(
81+
pub fn ref_callback(
8282
mut self,
83-
ref_callback: &PersistedCallback<Option<E>>,
84-
) -> Self
85-
where
86-
E: Deref<Target = Element> + OptionFromWasmAbi + 'static,
87-
{
83+
ref_callback: &PersistedCallback<Option<Element>>,
84+
) -> Self {
8885
self.props = self.props.ref_callback(ref_callback);
8986
self
9087
}

0 commit comments

Comments
 (0)