Closed mguidetti closed 4 years ago
@mguidetti This is a great change. Thank you for submitting it!
To share a bit of historical explanation, react-rails-form-helpers
uses a <span />
because it was written before the React.Fragment
API existed. React.Fragment
was introduced in React 16, but our current peer dependency communicates compatibility with React 15.
Even though this library remains pre 1.0.0
, I'm a little hesitant to change the peer dependency to React 16 out of courtesy for consumers that may unable to upgrade from React 15.
I have every intention to merge this improvement, but I'm gonna take some time to think about the best way to upgrade in a way that won't leave a broken experience for teams that don't have the bandwidth to upgrade.
@mguidetti You know what. This change seemed familiar, so I began digging through some former pull requests. We already transitioned one <span/ >
to <React.Fragment />
in #14, so the upgrade-story-ship has already sailed. I'm merging this, and will cut a new release when I am able.
Great! Very happy to have helped, and thank you again for your work on this!
Since the FieldsFor function just provides context to its children, it seems better to avoid rendering out extra enclosing HTML.
In my use case, the extra span tags that were added were causing some issues with my CSS selectors. This solved that issue for me.
Thanks for these great helpers!