react-element-to-jsx-string icon indicating copy to clipboard operation
react-element-to-jsx-string copied to clipboard

Inconsequent string wrapping

Open albingroen opened this issue 3 years ago • 0 comments

Input

  const Element = () => (
    <div>
      <p>
        {`{t('Cool')}`}
      </p>
      <p>
        {`t('Cool')`}
      </p>
    </div>
  )

Expected output

  const Element = () => (
    <div>
      <p>
        {t('Cool')}
      </p>
      <p>
        t('Cool')
      </p>
    </div>
  )

Actual output

  const Element = () => (
    <div>
      <p>
        {`{t('Cool')}`}
      </p>
      <p>
        t('Cool')
      </p>
    </div>
  )

Why is the first p element getting wrapped in {``}, bet second not. I expect the first to act as the second (ie. not get wrapped.)

albingroen avatar Aug 29 '21 10:08 albingroen