Skip to content

Using <Controls.Canvas> is returning error #52

@Theonlyhamstertoh

Description

@Theonlyhamstertoh

After installing with yarn add react-three-gui, I attempted to add it to my scene like this:

import { Controls, useControls } from "react-three-gui";

function App() {
  return (
    <Controls.Provider>
      <Controls.Canvas ></Controls.Canvas>
      <Controls />
    </Controls.Provider>
  );
}

When I write Controls.Canvas, it returns:

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `Context.Consumer`.
    at createFiberFromTypeAndProps (react-dom.development.js:25058)
    at createFiberFromElement (react-dom.development.js:25086)
   ...
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Where am I getting this wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions