Fix usage of div in CallOut - #399
Conversation
|
Hi, In my opinion, we should improve the component’s design: it should either accept a text prop and render a |
|
Hello @ddecrulle do you have something like this in mind ? {typeof children === "string" ? (
<p className={cx(fr.cx("fr-callout__text"), classes.text)}> {children} </p>
) : (
<div className={cx(fr.cx("fr-callout__text"), classes.text)}> {children} </div>
)}children having the type |
|
This implementation is close, but not exactly what we need. <div id="callout-6045" class="fr-callout">
<h3 class="fr-callout__title">Titre mise en avant</h3>
<p class="fr-callout__text">Lorem [...] elit ut.</p>
<button type="button" class="fr-btn">Libellé bouton</button>
</div>It's tricky to improve the current component without introducing a breaking change. |
|
Oh I found exactly the same issue with the Card component => #410 @ddecrulle I didn't understand your last comment. |
|
@benjlevesque @ddecrulle @garronej Cette PR est à l'arrêt depuis mai 2025 et elle est aujourd'hui en conflit avec Le point de blocage est une question de design, pas de code : @ddecrulle a écrit que remplacer le Deux issues voisines apportent un précédent utile : #410 sur @garronej @ddecrulle pouvez-vous trancher entre les trois options : (a) fermer en renvoyant vers la doctrine de #410, (b) accepter le changement minimal de cette PR, (c) demander la refonte avec breaking change ? @benjlevesque ne peut pas avancer, ni rebaser, tant que ce choix n'est pas fait. |
Similar to #394, but for CallOut
NB: this issue seems to exist for many components