search

Home  >  Q&A  >  body text

How to render using Hyperstack components in erb view

<p>For example, I have an erb page that contains a lot of logic. I want to create user message on this page using Hyperstack. How can I render Hyperstack components on this erb page? renew: I know this is possible because the Hyperstack component is embedded in application.erb. </p>
P粉301523298P粉301523298455 days ago469

reply all(1)I'll reply

  • P粉884548619

    P粉8845486192023-08-17 13:36:50

    I found the solution.

    erb file:

    <%= react_component('TestComponent') %>

    hyperstack components:

    class TestComponent < HyperComponent
      render(DIV) do
        '它运行正常'
      end
    end

    reply
    0
  • Cancelreply