1use frender_macros::custom_element;
2
3pub type StrictModeProps = crate::OptionalChildrenProps;
4
5pub struct StrictMode;
6
7#[custom_element(react = "crate")]
8pub struct StrictModeElement(crate::JsBridgeElement);
9
10impl crate::UseRenderStatic for StrictMode {
11 type RenderArg = StrictModeProps;
12 type RenderOutput = StrictModeElement;
13
14 #[inline]
15 fn use_render(props: &Self::RenderArg) -> Self::RenderOutput {
16 StrictModeElement(crate::JsBridgeElement {
17 js_component_type: crate::JsComponentType::Any(react_sys::StrictMode.clone()),
18 js_props_without_children: None,
19 children: props.children.clone(),
20 key: None,
21 })
22 }
23}
24
25impl crate::ComponentStatic for StrictMode {
26 type Props = StrictModeProps;
27 type Element = StrictModeElement;
28
29 #[inline]
30 fn create_element(props: Self::Props, key: Option<crate::Key>) -> Self::Element {
31 StrictModeElement(crate::JsBridgeElement {
32 js_component_type: crate::JsComponentType::Any(react_sys::StrictMode.clone()),
33 js_props_without_children: None,
34 children: props.children,
35 key,
36 })
37 }
38}