在道具中使用模板文字时,如何使换行符起作用?
const TypographyGroup = ({label, content}) => (
<div>
<FadedLabel type='subheading'>
{label}
</FadedLabel>
<Typography type='body1'>
{content}
</Typography>
</div>
)
<TypographyGroup
label='Address'
content={`${profile.company.billingAddress.street_1}
${profile.company.billingAddress.street_2}
${profile.company.billingAddress.city}, ${profile.company.billingAddress.state} ${profile.company.billingAddress.zip}`}
/>
在这里,我希望在street_1
and之后有一个换行符street_2
,但根本没有换行符。