Class: JsxRosetta::IR::ReactHookCall

Inherits:
Data
  • Object
show all
Includes:
Node
Defined in:
lib/jsx_rosetta/ir/types.rb

Overview

A React hook invocation detected in the component body (‘useState`, `useEffect`, …). Surfaced separately from local_bindings so backends can emit a more specific TODO that points at the Stimulus / Hotwire / server-render alternative, instead of a generic “translate this JS”.

hook : String — hook function name (‘“useState”`, `“useEffect”`, …) source : String — verbatim JS of the entire statement.

Instance Attribute Summary collapse

Instance Attribute Details

#hookObject (readonly)

Returns the value of attribute hook

Returns:

  • (Object)

    the current value of hook



55
56
57
# File 'lib/jsx_rosetta/ir/types.rb', line 55

def hook
  @hook
end

#sourceObject (readonly)

Returns the value of attribute source

Returns:

  • (Object)

    the current value of source



55
56
57
# File 'lib/jsx_rosetta/ir/types.rb', line 55

def source
  @source
end