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 }}
Repository navigation
Compiler silently drops <style ref={…}> (class-map ref supported by the tsrx JSX targets) #940
@tsrx/core's JSX targets (React, Preact, Solid, Vue) support <style ref={x}>…</style>: the block's class-map object ({ $class, card, … }) is handed to x (assignment, callback, or a current/value ref) through createStyleRefSetupStatements. Octane's compiler has never handled that attribute: the analyzer accepts ref on a <style> block, but the scope pass strips the block and the ref target is never written, on main and on #939 alike.
export function App() @{
let classes;
<>
<div class="a">a</div>
<style ref={classes}>.a { color: red; }</style>
</>
}
compiles with no diagnostic and classes stays undefined.
Options: implement it in packages/octane/src/compiler/style-scopes.js (the scope's class map is already built there; createStyleClassMap / createStyleRefSetupStatements are exported by @tsrx/core) for statement-list scopes and returned templates, or report ref on a <style> block as unsupported until then. Either is better than the silent drop.
Activity
jonkwheeler commentedon Sep 4, 2026
Working on this in #960
@leonidaz style ref now writes the class map (no silent drop).
fix: write style-block class maps to ref targets (octanejs#960)