Closed viniciuspalma closed 8 years ago
Currently a bundle can only be rendered once per page. You may want to look into creating one react bundle that takes an array, and renders all the items - ie, 1 bundle of N things, rather than N of 1 thing?
We are working on a way to make this work, but I do think that a single React tree would be a strictly better approach in the meantime.
Ohh, thanks for the dynamic response. How I said, I'm working in a migration from react-rails to hypernova, and with react rails I use this approach to render this items. And with this facts I'll change the way how I currently render components.
@ljharb Any chance this might work in the near future? When using Hypernova as an easy way to include React components into a Rails view, it would be nice (at least in my project) to be able to render a single component more than one time. Seems like it doesn't work right now...
@dpuscher the workaround is to make a different top-level component for each instance you want to render. Do you have a specific use case where this is difficult?
Hi, I'm testing a migration from react-rails to hypernova. And I have a problem with render components in a loop. for example:
Only the first item was rendered, and the others just created a
<script>
tag with the props(data) of request, but the react component was not rendered. And I don't know why :D.