Skip to content

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

Open

Description

@jaballogian

This repo is an amazing example.
But I found an issue.
I tried to copy the code (here is my repo https://github.com/jaballogian/learn-react-hypertrack).
Then I ran the code on my local computer and got an error (as in the screenshot).
Then I tried to change to use the functional react component (and hooks) and still got the same error.

image

Activity

  1. jaballogian commented on Oct 26, 2020

    @jaballogian
    Author

    FOUND THE SOURCE OF THE ERROR

    I tried to comment on the LiveView component (as seen in the image below, here is the link to the file https://github.com/jaballogian/learn-react-hypertrack/blob/master/src/App.js).
    image

    Then all of the errors were gone (as seen in the image below).
    image

    So I thought that the source of the error was from the LiveView component.

    But it still didn't solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions