Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

202
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda