Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Invalid hook call. #28

Open
dinhostork opened this issue Mar 28, 2020 · 8 comments
Open

Error: Invalid hook call. #28

dinhostork opened this issue Mar 28, 2020 · 8 comments

Comments

@dinhostork
Copy link

dinhostork commented Mar 28, 2020

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;
@BlackCatTB
Copy link

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

Help

@MelodicCrypter
Copy link

MelodicCrypter commented Dec 4, 2020

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

@preddzdesign
Copy link

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

@MelodicCrypter
Copy link

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

@xAl3xFx
Copy link

xAl3xFx commented Mar 12, 2021

+1

@xAl3xFx
Copy link

xAl3xFx commented Mar 14, 2021

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

@BeanVortex
Copy link

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!

@kkersel
Copy link

kkersel commented Sep 14, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants