You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 11, 2021. It is now read-only.
htm allows us to write JSX-like code within tagged template literals, removing the need for JSX transpilation. Unfortunately, it does not support TypeScript very well. I cannot use TypeScript to verify the props and return types of my custom components.
functionMyComponent(props){// propA, propB are not type-checkedreturnhtml`<divclass="my-component"><${InnerComponent}propA="foo" propB=${bar}/></div> `;}
The h() function is properly typed. Maybe I could use it instead?
Some options:
Write JSX and transpile with TypeScript
No-go, since one of this project's major goal is to write JS code that just runs with no transpilation.
htm allows us to write JSX-like code within tagged template literals, removing the need for JSX transpilation. Unfortunately, it does not support TypeScript very well. I cannot use TypeScript to verify the props and return types of my custom components.
The
h()
function is properly typed. Maybe I could use it instead?Some options:
Write JSX and transpile with TypeScript
No-go, since one of this project's major goal is to write JS code that just runs with no transpilation.
Write everything with
h()
Perfect for typing, but too verbose.
Write HTML with htm, but insert custom components with
h()
This looks like a good middle ground, but I'm not sure if it would work.
The text was updated successfully, but these errors were encountered: