react-preloaders icon indicating copy to clipboard operation
react-preloaders copied to clipboard

Error: Invalid hook call.

Open dinhostork opened this issue 5 years ago • 8 comments

After install and set up app just reporting the following error:

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This >could happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.

image

This is my App.js as it recommends

import React from 'react';
import Routes from './routes';
import GlobalStyle from './Styles/global';
import { Lines } from 'react-preloaders';

function App() {
    return (
        <>
            <Routes />
            <GlobalStyle />
            <Lines />
        </>
    );
}

export default App;

dinhostork avatar Mar 28 '20 06:03 dinhostork

Yes me too! I have the exact setup as the "Simplest way"

Help

BlackCatTB avatar Nov 11 '20 14:11 BlackCatTB

I'm also experiencing this. Latest React, with TypeScript. Any solution to this? @VamOSGS

MelodicCrypter avatar Dec 04 '20 08:12 MelodicCrypter

I'm getting the same problem: 'Error: Invalid hook call'

preddzdesign avatar Dec 04 '20 13:12 preddzdesign

I'm getting the same problem: 'Error: Invalid hook call'

I submitted a PR above @preddzdesign for this error...hoping creator/maintainer will notice to check it

MelodicCrypter avatar Dec 04 '20 14:12 MelodicCrypter

+1

xAl3xFx avatar Mar 12 '21 22:03 xAl3xFx

I have forked and fixed this issue. You can find the fixed package here : https://www.npmjs.com/package/react-preloaders2

xAl3xFx avatar Mar 14 '21 14:03 xAl3xFx

I have forked and fixed this issue. You can find the fixed package here : https://www.npmjs.com/package/react-preloaders2

this package works but it is heavy!

BeanVortex avatar Oct 21 '21 15:10 BeanVortex

Chrome working

Safari doesn't Chrome Mobile doesn't

Is it just me? 'time' working only in chrome ( desktop )

index.js Screenshot 2022-09-14 at 07 18 37

the rest are rebooted

kkersel avatar Sep 14 '22 04:09 kkersel