Closed solaris7x closed 2 years ago
Hey! 👋 Nice idea, however I think this is best suited to user code instead. You should be able to do:
function Line({ children }) {
return <>{children}{"\n"}</>;
}
...then use <Line>
like a regular component.
That's one clean way to use it. As it is used to frequently , I suggested to add it as a helper component.
It is common to write multi-line messages and the current way to add newline
{"\n"}
doesn't play nice with prettier formatter.The current workaround I am using to keep my message in code and in discord look visually the same is wrapping each line into a Fragment and adding
{"\n"}
between fragments. This stops prettier from squashing all the line and each fragment gets it own separate line.Thus I propose to add a
<Line>
component that work as Fragment with newline , essentially giving a html block like feel and keep message in code visually similar to that in final output.