Class: JsxRosetta::IR::EventHandler
- Inherits:
-
Data
- Object
- Data
- JsxRosetta::IR::EventHandler
- Includes:
- Node
- Defined in:
- lib/jsx_rosetta/ir/types.rb
Overview
An arrow/function expression whose body isn’t JSX — typically a JSX event handler on a PascalCase component (‘onClick==> doX()`) or a non-JSX-returning callback prop. We can’t translate arbitrary JS bodies to Ruby procedurally, so backends emit a stub method on the class with the verbatim JS body preserved as a TODO comment; the kwarg at the use site becomes ‘method(:method_name)` so the receiving component has a callable reference and the structural attachment is preserved end-to-end.
params : [String] body_source : String — verbatim JS of the arrow/function body
(the part after `=>` for arrows, or the full block
body for FunctionExpressions). Preserved as a
comment in the emitted method so the reviewer can
translate the behavior to Ruby.
Instance Attribute Summary collapse
-
#body_source ⇒ Object
readonly
Returns the value of attribute body_source.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Attribute Details
#body_source ⇒ Object (readonly)
Returns the value of attribute body_source
542 543 544 |
# File 'lib/jsx_rosetta/ir/types.rb', line 542 def body_source @body_source end |
#params ⇒ Object (readonly)
Returns the value of attribute params
542 543 544 |
# File 'lib/jsx_rosetta/ir/types.rb', line 542 def params @params end |