Encapsulate widget with fragment gives an error

When trying to encapsulate my widget with a fragment node, the error ‘attempting to create fragment node’ keeps showing up. I don’t see what i’m doing wrong. Anyone that can help?

 <Fragment>
      <Rectangle width={10} height={10} />
      <SVG
        cornerRadius={10}
        src={`
        <svg>
          <path fill="#ffffff" d="${vertices.map(({ x, y }, key) => {
          ... }"/>
        </svg> 
      `} />
      < Input
        font={font}
        onTextEditEnd={({ characters }) => {
          setText(characters)
          loadFonts().then(() => {
            setVertices(generateBackground(characters))
          })
        }
        }
        value={text}
        fill="#031037"
        inputBehavior="multiline"
      />
    </Fragment>

Any solution in meantime ?

@Robbe_Keters, @mrkimedo, could you show more function code or explain where you are trying to return a Fragment?

Well I am trying to achieve simple thing, I want to have multiple Ellipses and have only one shown in specific time, by that I mean to set hidden property based on some condition. And now the problem is that I need to have Fragment so I could return multiple components without the need of parent component like AutoLayout.

I assumed that you are returning a Fragment without having a parent component. Only this way I was able to get this error.

I don’t know if this is a bug in the Figma engine or something else, but you can try contacting support by sending them all the necessary information.

1 Like

Will do surly, thanks on fast answer


just a little update on problem that we were facing

2 Likes

Awesome, thanks for the update. I eventually just encapsulated everything with a frame and made the width and height dynamic by checking it’s contents, which was a huge pain for something simple.

1 Like