use optional chaining

This commit is contained in:
Christophe Robillard 2022-10-31 15:43:06 +01:00
parent 7441218c7f
commit de072c8b3d

View file

@ -85,7 +85,7 @@ export function toggle(el: Element | null, force?: boolean) {
export function toggleExpandIcon(icon: Element | null) {
icon?.classList.toggle('fr-icon-add-line');
icon?.classList.toggle('fr-icon-subtract-line');
icon?.classList?.toggle('fr-icon-subtract-line');
}
export function enable(