Zeilenumbruch mit der .join-Methode
Posted: 20 Jan 2025, 18:35
Ich bin neu bei ReactJS und versuche, beizutreten, was funktioniert, aber ich möchte nach jedem „Hallo Kontinent“ eine Pause einlegen.
und \n funktionieren nicht. Das br-Tag funktioniert in normalem JS, reagiert aber nicht.
Was ich suche, ist
Hallo Afrika
Hallo Amerika
usw.
Was ich bekomme, ist Hallo Afrika, Hallo Amerika usw.
und \n funktionieren nicht. Das br-Tag funktioniert in normalem JS, reagiert aber nicht.
Was ich suche, ist
Hallo Afrika
Hallo Amerika
usw.
Was ich bekomme, ist Hallo Afrika, Hallo Amerika usw.
Code: Select all
const continents = ['Africa','America','Asia','Australia','Europe'];
const helloContinents = Array.from(continents, c => `Hello ${c}!`);
const message = helloContinents.join("
");
const element = (
{message}
);