algolia / react-element-to-jsx-string

Turn a ReactElement into the corresponding JSX string

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Format prop elements

neutraali opened this issue · comments

r-e-t-j-s (version 14.3.2) formats child elements pretty well, like so:

<p>
  <Button color="primary" onClick={handleFunction} text="Primary" />
</p>

... However, elements passed as props get the inline -treatment:

<Filter
  filters={<Form><FormField><label>Input:</label><Input name="single-input" onChange={handleFunction} value={undefined} /></FormField></Form>}
  onClear={handleFunction}
/>

maxInlineAttributesLineLength seems to have no effect here. Is there a way to get "prop elements" to get pretty-printed in the same way as regular children are? Or am I simply doing something wrong?

It should be the case. Could you provide a reproducible example?