Skip to main content
Question

Encapsulate widget with fragment gives an error


Robbe_Keters

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>

7 replies

mrkimedo
  • 5 replies
  • September 24, 2022

Any solution in meantime ?


tank666
  • 4872 replies
  • September 25, 2022

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


mrkimedo
  • 5 replies
  • September 25, 2022

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.


tank666
  • 4872 replies
  • September 25, 2022

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.

figma.com

mrkimedo
  • 5 replies
  • September 25, 2022

Will do surly, thanks on fast answer


mrkimedo
  • 5 replies
  • October 3, 2022


just a little update on problem that we were facing


Robbe_Keters

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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings