Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevent break line of array props value #31

Open
gabrielrtakeda opened this issue Feb 21, 2018 · 1 comment
Open

prevent break line of array props value #31

gabrielrtakeda opened this issue Feb 21, 2018 · 1 comment

Comments

@gabrielrtakeda
Copy link

gabrielrtakeda commented Feb 21, 2018

Hi!
Is there any way to prevent the react-element-to-jsx-string to breaking lines on an array value props? Bellow follows an example:

Input code

<Row>
  <Cell>
    <Block>[1, 2, 3, 4, 6, 12]</Block>
  </Cell>

  <Cell size={[8, 2, 3, 4, 6, 6]}>
    <Block>[8, 2, 3, 4, 6, 6]</Block>
  </Cell>

  <Cell size={[null, null, null, null, null, 6]}>
    <Block>[1, 2, 3, 4, 6, 6]</Block>
  </Cell>

  <Cell size={[2]}>
    <Block>[2, 2, 3, 4, 6, 12]</Block>
  </Cell>
</Row>

Output formatted code

<Row>
  <Cell>
    <Block>
      [1, 2, 3, 4, 6, 12]
    </Block>
  </Cell>
  <Cell
    size={[
      8,
      2,
      3,
      4,
      6,
      6
    ]}
  >
    <Block>
      [8, 2, 3, 4, 6, 6]
    </Block>
  </Cell>
  <Cell
    size={[
      null,
      null,
      null,
      null,
      null,
      6
    ]}
  >
    <Block>
      [1, 2, 3, 4, 6, 6]
    </Block>
  </Cell>
  <Cell
    size={[
      2
    ]}
  >
    <Block>
      [2, 2, 3, 4, 6, 12]
    </Block>
  </Cell>
</Row>
@hipstersmoothie
Copy link
Contributor

This seems to be a problem upstream with https://github.com/algolia/react-element-to-jsx-string/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants