I am studying React JS, but I have some difficulties so I am writing a question.
Here is my code.
const ServiceList = [{
icon: '01',
title: 'TEST',
description: 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered.',
}, {
icon: '02',
title: 'TEST',
description: 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered.',
}, {
icon: '03',
title: 'TEST',
description: 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered.',
}, ]
{
ServiceList.map((val , i) =>
(
<div className="col-lg-4 col-md-6 col-sm-6 col-12" key={i}>
<p>{val.description}</p>
</div>
)
)
}
In this code, I want to display val.description like this
<p>
There are many variations of passages of Lorem Ipsum available,
<br />
but the majority have suffered.
</p>
I've tried several methods (like
,
, etc..) so that the content of the description is a line break like the <br />
tag, but it didn't work.
Please tell me another try options.
Very Thanks.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…