rmorse / babel-plugin-jsx-template-vars

A Babel transform for rendering a template version of your React / Preact app. Useful for generating a pre-render for SSR.
MIT License
10 stars 0 forks source link

Position of `.templateVars` #12

Closed rmorse closed 2 years ago

rmorse commented 2 years ago

Right now, .templateVars must be immediately after the component definition.

const MyComponent = ( { name } ) => <>{ name }</>;
// Nothing can go here!
MyComponent.templateVars[ 'name' ];

If there is anything else in between the two, it breaks...

Need to reliably find the component definition from the .templateVars prop so this can be more flexible.

rmorse commented 2 years ago

This has been fixed in v0.0.8