|
1 | 1 | use super::Props;
|
2 | 2 | use crate::{
|
3 |
| - callback::PersistedCallback, create_element, hooks::JsRefContainer, KeyType, |
4 |
| - VNode, VNodeList, |
| 3 | + callback::PersistedCallback, create_element, hooks::JsRefContainer, VNode, |
| 4 | + VNodeList, KeyType, |
5 | 5 | };
|
6 |
| -use std::{borrow::Cow, ops::Deref}; |
| 6 | +use std::borrow::Cow; |
7 | 7 | use wasm_bindgen::{
|
8 |
| - convert::{FromWasmAbi, IntoWasmAbi, OptionFromWasmAbi}, |
| 8 | + convert::{FromWasmAbi, IntoWasmAbi}, |
9 | 9 | JsValue,
|
10 | 10 | };
|
11 | 11 | use web_sys::Element;
|
@@ -67,24 +67,21 @@ impl<T: HType> H<T> {
|
67 | 67 | /// [`use_js_ref()`](crate::hooks::use_js_ref()) hook.
|
68 | 68 | ///
|
69 | 69 | /// [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 { |
74 | 74 | self.props = self.props.ref_container(ref_container);
|
75 | 75 | self
|
76 | 76 | }
|
77 | 77 |
|
78 | 78 | /// Sets the [React ref][ref] to the given ref callback.
|
79 | 79 | ///
|
80 | 80 | /// [ref]: https://reactjs.org/docs/refs-and-the-dom.html
|
81 |
| - pub fn ref_callback<E>( |
| 81 | + pub fn ref_callback( |
82 | 82 | 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 { |
88 | 85 | self.props = self.props.ref_callback(ref_callback);
|
89 | 86 | self
|
90 | 87 | }
|
|
0 commit comments