Footer Dynamic Copyright ReactJs

const currentYear = (new Date().getFullYear())
const yearTxt = currentYear === 2022 ? "2022" : "2022 - "+currentYear

return (
  <footer class="footer">
  © { yearTxt } Service - Developed by Company
  </footer>
)
capitalistlion