1

There is this old chat that suggests writing your own fragment wrapper, but I understand that fragment should now be natively supported. However I couldn't quickly find the correct syntax for it.

Example of what I'm looking for:

<fragment>
  <button label="foo"/>
  <button label="bar"/>
</fragment>
Peter Lamberg
  • 8,151
  • 3
  • 55
  • 69

1 Answers1

1

Here is the official documentation page on reason-react and fragments.

The syntax for using React fragments in reason-react is this:

<>
  <button label="foo"/>
  <button label="bar"/>
</>

The terse syntax may be easy to miss if you are looking hard for something like <Fragment> (this is what happened to me). I first found the answer in the release notes for version 0.5.0

Peter Lamberg
  • 8,151
  • 3
  • 55
  • 69