origami_engine

Macro comp

source
comp!() { /* proc-macro */ }
Expand description

§comp! Macro

The comp! macro generates a reusable component by defining its structure and allowing the replacement of props. This facilitates the creation of dynamic components that can be rendered with different values.

§Example

use origami_macros::{comp};

comp! {
    greeting_component(name) =>
    div {
        "Hello, "
        @name;
    }
     
}

let html = greeting_component!(name { "World" });
assert_eq!(html.0, "<div>Hello, World</div>");