Coder Social home page Coder Social logo

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 about react-doc-viewer HOT 12 OPEN

alcumus avatar alcumus commented on May 31, 2024 5
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

from react-doc-viewer.

Comments (12)

fuadchonora avatar fuadchonora commented on May 31, 2024 3

Install the package using yarn
yarn add react-doc-viewer

from react-doc-viewer.

deepak-agarwal avatar deepak-agarwal commented on May 31, 2024 2

I am getting the same issue, can anyone help here. @mattmogford-alcumus

from react-doc-viewer.

prem-pachouri-infopro avatar prem-pachouri-infopro commented on May 31, 2024 2

https://www.npmjs.com/package/@cyntler/react-doc-viewer is working fine for me

from react-doc-viewer.

rusicsemenov avatar rusicsemenov commented on May 31, 2024 1

I don't why, but if you run install from the yarn as yarn install all will work perfectly.

from react-doc-viewer.

nimsathi avatar nimsathi commented on May 31, 2024

I'm facing the same issue

from react-doc-viewer.

minericpark avatar minericpark commented on May 31, 2024

Same for me as well, using CRA!

NPM version: 7.16

from react-doc-viewer.

minericpark avatar minericpark commented on May 31, 2024

For those who are still looking into this issue, it seems like this package has some sort of incompatibilities with the latest Node versions or NPM versions.

What fixed it for me is downgrading my Node version from 16.3.0 -> 10.24.1 (with npm 7.15.1 -> 6.14.12). There was no react hook error since, and the component rendered properly.

from react-doc-viewer.

chenshuiluke avatar chenshuiluke commented on May 31, 2024

I'm encountering the same issue.

from react-doc-viewer.

tebareinyu avatar tebareinyu commented on May 31, 2024

Install the package using yarn yarn add react-doc-viewer

Works, Thank you!!

from react-doc-viewer.

penfold45 avatar penfold45 commented on May 31, 2024

Did anyone fiugre out how to install this with NPM and not have this issue?

from react-doc-viewer.

devashishp1999 avatar devashishp1999 commented on May 31, 2024

In my case it got resolved by deleting node-modules and then install with yarn.

from react-doc-viewer.

abdessamadpas avatar abdessamadpas commented on May 31, 2024

I was able to successfully test my project using npm, but when I attempted to integrate it into my main app, I encountered the same error. However, I am unable to switch to using yarn for a solution. Do you have any ideas for helping me resolve this issue?

from react-doc-viewer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.