Skip to content

Commit b0e654c

Browse files
committed
feat: React.useRef<bool>
1 parent 152f712 commit b0e654c

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Rust bindings for `React`.
1212
`Cargo.toml`
1313

1414
```toml
15-
react-sys = "1.0.0-alpha.4"
15+
react-sys = "1.0.0-alpha.7"
1616
```
1717

1818
Though the version is at `1.x-alpha`,

src/use_ref/helpers.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@ define_react_use_ref_helpers! {
99
use_ref_usize,
1010
use_ref_usize_with,
1111
},
12+
{
13+
value: bool,
14+
object: MutableRefObjectBool,
15+
use_ref_bool,
16+
use_ref_bool_with,
17+
},
1218
}

src/use_ref/macro_helpers.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::stringify;
2+
13
macro_rules! define_react_use_ref_for_type {
24
( { value: $type_value:ty, $($t:tt)+ } ) => {
35
define_react_use_ref_for_type! {{
@@ -14,10 +16,7 @@ macro_rules! define_react_use_ref_for_type {
1416
$name_use_with:ident
1517
$(,)?
1618
}) => {
17-
use $crate::macro_import::wasm_bindgen_react;
18-
use std::stringify;
19-
20-
wasm_bindgen_react! {
19+
$crate::macro_import::wasm_bindgen_react! {
2120
/// MutableRefObject<
2221
#[doc = stringify!($output_type)]
2322
/// >

0 commit comments

Comments
 (0)