hamayuzinの日記

エンジニアとかデータサイエンティストとかやってます。あの時 あれやってたな的な備忘録にできれば。

【Rails/react】Railsでreactを使う時のhelper methodの違い

railsでreactを使っていると、2つhelper methodがあることに気づく <%= javascript_pack_tag ‘hello_react’ %> <%= react_component("HelloWorld", { greeting: "Hello" }) %>

それぞれの違いがよくわかってなかったけど、変数渡せるかなのかな??

javascript_pack_tag

<%= javascript_pack_tag 'comment' %>

react_component

<%= react_component('Comment', account_id: '1') %>