Open gabsbelini opened 5 years ago
I believe this is actually intended behavior as per the template literal specifications: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals.
The way around this is to actually put the break in the string:
const lineBreak = `first line
second line`;
Alternatively, check out the tagged templates documentation for more advanced functionality https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates, or a helper library like https://www.npmjs.com/package/common-tags.
I get the same issue. And I use React Typescript with not allow me to use the above workaround. Is there any update on this issue?
I'm trying to add a column name that has a multiline string, i.e:
${line1}\n${line2}
But the result is: "line1line2"Expected Behavior
What I wanted to see is:
Current Behavior
What I see:
Workaround
The problem does not happen if a use an HTML object instead of a template string such as:
But then when I download the table data I get [object Object] for the referred column
Your Environment