1#![warn(missing_docs)]
2#![doc = include_str!("../README.md")]
3
4#[cfg(doctest)]
6#[doc = include_str!("../README.md")]
7extern "C" {}
8
9mod builtin_components;
10mod callback;
11mod component;
12mod context;
13mod macros;
14mod prop_container;
15mod vnode;
16
17pub mod hooks;
18pub mod props;
19#[doc(hidden)]
20pub mod react_bindings;
21
22use props::Props;
23use wasm_bindgen::prelude::*;
24
25pub use builtin_components::*;
26pub use callback::*;
27pub use component::*;
28pub use context::*;
29#[doc(hidden)]
30pub use paste::paste;
31pub use prop_container::*;
32pub use vnode::*;
33
34#[doc(hidden)]
37#[wasm_bindgen]
38pub struct WasmReact;
39
40#[wasm_bindgen]
41impl WasmReact {
42 #[wasm_bindgen(js_name = useReact)]
60 pub fn use_react(value: &JsValue) {
61 react_bindings::use_react(value);
62 }
63}
64
65pub fn create_element(typ: &JsValue, props: &Props, children: VNode) -> VNode {
69 VNode::Single(react_bindings::create_element(
70 typ,
71 props.as_ref(),
72 &children.into(),
73 ))
74}