Skip to content

Inconsequent string wrapping #614

Open
@albingroen

Description

@albingroen

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.)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @albingroen

        Issue actions

          Inconsequent string wrapping · Issue #614 · algolia/react-element-to-jsx-string