react-sys 1.0.0-alpha.23

React bindings for rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
mod macro_helpers;

mod helpers;
pub use helpers::*;

use wasm_bindgen::prelude::*;

crate::macro_import::wasm_bindgen_react! {
    #[wasm_bindgen(js_namespace = React, js_name = useState)]
    pub fn use_state(initial_state: JsValue) -> Box<[JsValue]>;

    #[wasm_bindgen(js_namespace = React, js_name = useState)]
    pub fn use_state_with(initial_state: &mut dyn FnMut() -> JsValue) -> Box<[JsValue]>;
}