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

396
Views
Brand new project with no code other than App.js: Error: Invalid hook call. Hooks can only be called inside of the body of a function component

When trying to use the CountdownCircleTimer from react-countdown-circle-timer, I get the following errors in my browser:

enter image description here

enter image description here

enter image description here

I only have the following code, absolutely nothing else, no other components in my React project:

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;

Here is what my package.json looks like:

"dependencies": {
    "react": "^17.0.2",
    "react-countdown-circle-timer": "^2.5.4",
    "react-dom": "^17.0.2"
  }

Here is my index.js file:

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
);

I am at a loss as to why this is happening. What can I do to fix it? This is a brand new React project and I wanted to test this component inside App.js before moving forward.

Thank you.

about 4 years ago · Juan Pablo Isaza
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!