Skip to content

Commit 1537f23

Browse files
committedAug 1, 2023
fix: work around jetli/yew-hooks#35
1 parent e956471 commit 1537f23

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎src/components/file_upload/file_upload.1.example

+8-4
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,16 @@
190190

191191
let oninput_text = use_callback(|new_text, drop_content| drop_content.set(DropContent::from(new_text)), drop_content.clone());
192192

193-
let force = use_force_update();
194-
use_effect_with_deps(move |()| force.force_update(), ());
193+
html!(<>
194+
// Due to https://github.com/jetli/yew-hooks/issues/35 the ref currently must be on a direct element
195+
// of this component. It cannot be on an element nested by another component.
196+
<div ref={node.clone()}>
195197

196-
html!(
197198
<Form>
199+
198200
<FormGroup>
199201
<FileUpload
200202
drag_over={*drop.over}
201-
r#ref={node.clone()}
202203
>
203204
<FileUploadSelect>
204205
<InputGroup>
@@ -238,9 +239,12 @@
238239
/>
239240
</FileUploadDetails>
240241
</FileUpload>
242+
241243
{helper_text}
242244
</FormGroup>
243245
</Form>
246+
</div>
247+
</>
244248
)
245249
}
246250

0 commit comments

Comments
 (0)