vydimitrov / react-countdown-circle-timer

Lightweight React/React Native countdown timer component with color and progress animation based on SVG
MIT License
692 stars 87 forks source link

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. #176

Closed moebachrouch closed 3 years ago

moebachrouch commented 3 years ago

I installed react-countdown-circle-timer to my project, and decided to only use it inside my App.js before adding any additional components or even starting my project.

Here is my code currently:

import './App.css';
import { CountdownCircleTimer } from "react-countdown-circle-timer";

function App() {
  return (
    <div className="App">
      <Timer/>
      <CountdownCircleTimer
        isPlaying
        duration={10}
        colors={[
          ["#004777", 0.33],
          ["#F7B801", 0.33],
          ["#A30000", 0.33],
        ]}
      />
    </div>
  );
}

export default App;

I have no other components.

However I get the following errors:

image

emileber commented 3 years ago

Tested it and can't reproduce with the available information. Here's the Stack Overflow thread for anyone reading this.