ozanmakes / ppx-tea-jsx

Reason JSX syntax for BuckleScript-TEA
MIT License
51 stars 2 forks source link

How does it work with custom element? #3

Open mistyharsh opened 5 years ago

mistyharsh commented 5 years ago

Thank you for the great library.

I am trying to use this library with custom-elements/web-components. How can I use this with JSX?

let x = node("iron-icon", [ attribute("", "icon", "search") ], []);

let view = (m: range) =>
    <div className="">
        {x}
        <iron-icon icon="search"></iron-icon>
        <span>{text(lowerBound)}</span>
    </div>;

I could not really figure out the correct usage. As a workaround, I am currently using node function as a workaround.