renchap/webpacker-react

render in a different tag than div?

Closed this issue · 2 comments

Right now the default tag the React component is rendered in is a div, is it possible to render in something else with a param? I tried span: 'div' without any luck.

This is not supported right now, but it‘s pretty easy to implement. You can send a tag as part of the options hash to the render function and then have content_tag use that if present, defaulting to div.

Take a look at the relevant line.

I just released version 0.3.0 with this feature!