Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!