ansi-to-react
ansi-to-react copied to clipboard
Add support to return a span element without a code wrap
Currently, it seems that React can't handle the memory pressure when a large output of text is being rendered. This PR is part of the solution for this issue and adds a new prop that indicates whether Ansi should return a span element without a code wrap.
Is there a reason to support this (eg, what's the use case)? Semantically, code
is almost always the correct choice.
Also, the pattern I've seen for this stuff out "in the wild" is using an as
prop (Reach UI is the example that comes to mind). So instead of <Ansi spanify />
you'd use <Ansi as="span" />
.
Yes, I just opened this issue that explains in a better way the reason to support this and updated the description of this PR.
Thanks for the suggestion! I'm going to change the prop, to follow the pattern you mentioned.