Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

86
Vistas
How to extract a React key from a js Date?

I'm building a schedule calendar in React and wondering what's the best way to extract a key from a js Date object? I'm already using the date-fns library but haven't seen anything about ids in their documentation.

to be clear, each date only appears once in the list so I'm looking for the fastest way to get a unique key out of a date, without using the object reference.

So far I'm using date.valueOf() or format(date, 'yyyy-mm-dd') although I feel that might be overkill since it might be recalculated every render.

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.