【发布时间】:2020-06-15 16:11:24
【问题描述】:
我正在使用react_rails 在 Ruby on Rails 应用程序中的超薄模板内渲染反应组件。有没有办法将子组件传递给 React 组件,在该组件中,子组件以苗条的形式呈现在服务器端?
这是我最想要的:
<MyComponent>
<p>my custom content</p>
</MyComponent>
内容来自模板本身,如下所示:
= react_component 'MyComponent' do
p my custom content
这可能吗?如果是这样,将孩子传递给 react_component 的最佳方法是什么?
【问题讨论】:
标签: ruby-on-rails reactjs slim-lang react-rails