Skip to content

Unable to import react-countdown #545

Description

@Afsoon

Describe the bug
Unable to import React Countdown, I notice that the original source code mix PropTypes with TS and is a React Class component.

To Reproduce
Steps to reproduce the behavior:

  1. Create a project from zero
  2. Install the react-countdown library.
  3. Create a basic component, as the following:
import Countdown, { CountdownRenderProps } from 'react-countdown';

function timerRenderer ({ completed, seconds, minutes  }: CountdownRenderProps){
 if (completed) {
  return <span>00:00</span>;
 } else {
  return <span>{minutes}:{seconds}</span>;
 }
}

export default function Timers() {
  return <Countdown date={Date.now() + 70000} renderer={timerRenderer} />
}
  1. The dev tools display the following error:
    imagen
  2. The compiled code is the following:
    imagen

Expected behavior
Be able to import react-countdown component.

Desktop (please complete the following information):

  • OS: OS X 10.15.17
  • Browser: Firefox 87.0
  • Node Version: 14.8.0
  • WMR Version: 1.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions