Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

197
Vistas
import isPast Module '"data-fns"' has no exported member 'isPast'.ts(2305)

could you help me?

When i try import tag "isPast" of data-fns to react.tsx, show that message: import isPast Module '"data-fns"' has no exported member 'isPast'.ts(2305) or 'isPast' is declared but its value is never read.

So, i don't know what i do! Im begginer...

import { CheckCircle, Lock } from 'phosphor-react'

import {isPast} from 'data-fns' //The error is over here!

interface LessonProps {
  title: string;
  slug: string;
  availableAt: Date;
  type: 'Live' | 'class';
}

export function Lesson(props: LessonProps) {
  const isLessonAvailable = isPast(props.availableAt);
  
  return(
    <a href="#">
      <span className="text-gray-300">
        {props.availableAt.toString()}
      </span>

      <div className="rounded border border-gray-500 margin top-2 p-4">
        <header className="flex items-center justify-between">
          {isLessonAvailable?(
            <span className="text-sn text-blue-500 font-medium flex items-center gap-2">
            <CheckCircle size={20}/>
            Conteúdo liberado
          </span>
          ) : (
            <span className="text-sn text-orange-500 font-medium flex items-center gap-2">
              <Lock size={20}/>
              Em breve 
            </span>
          )}
          <span className="text-xs rounded py-[0.125rem] px-2 text-white font bold border border-green-300">
            {props.type == 'Live' ? 'AO VIVO' : 'AULA PRATICA'}
          </span>
        </header>

        <strong className="text-gray-200 mt-5 block">
          {props.title}
        </strong>
      </div>
    </a>

  )
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have a typo. It is date-fns. Make sure you have it installed as well

npm i date-fns

Last advice: get a good linter, cause it would complain that there no such a module as data-fns

enter image description here

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda