How to use spread operator inside fragment

reasonreact

#1

Hi all,
Is it possible to use spread operator inside fragment quotes?

let make = (children: array(ReasonReact.reactElement)) => {
...
render: _ =>
      <div>
        <Navbar>
         /* ... */
        </Navbar>
        <> ...children </> /* [bucklescript] 251: <syntax error> */
      <div/>,

but this works as expected:

  <div> ...children </div> 

#2

Hmmm that sounds like a parser bug.


#3

I believe the blog entry mentioned that spread in fragments is not yet supported!

See https://github.com/reasonml/reason-react/blob/master/HISTORY.md#050 for reference! (JSX Section)


#4

Right. It’s not supported, and also currently doesn’t parse. It’s very unclear what that should become.