ruby-on-railsrubyreactjsisomorphichyperstack

How do I enable params as methods in Hyperstack


I would like to use:

class UserDetails < HyperComponent
  param :user

  render do
    H1 { user.name }
  end

Instead of

class UserDetails < HyperComponent
  param :user

  render do
    H1 { @User.name }
  end

How do I enable this as the default?


Solution

  • class HyperComponent
      include Hyperstack::Component
      include Hyperstack::State::Observable
      param_accessor_style :accessors  # this is now the prefered param style
    end