use ToString

This commit is contained in:
Ilya Maximov committed 2022-03-19 02:57:39 +01:00
1 parent 5cbf2698fd
commit b4a5fe9845
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@ use dioxus_core::*;
///
/// The closure will panic if the provided script is not valid JavaScript code
/// or if it returns an uncaught error.
pub fn use_eval<S: std::fmt::Display>(_cx: &ScopeState) -> impl Fn(S) {
pub fn use_eval<S: std::string::ToString>(_cx: &ScopeState) -> impl Fn(S) {
|script| {
js_sys::Function::new_no_args(&script.to_string())
.call0(&wasm_bindgen::JsValue::NULL)