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

ToggleButton does not work #134

Open
cody-lettau opened this issue Mar 2, 2021 · 3 comments
Open

ToggleButton does not work #134

cody-lettau opened this issue Mar 2, 2021 · 3 comments

Comments

@cody-lettau
Copy link
Collaborator

🐞 bug report

The ToggleButton component throws an error when being rendered:

React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

Description

When using the ToggleButton component, an error is thrown when rendering it (see error above). The issue appears to possibly be related to how the react-toggle import is defined. See http://aaronshaf.github.io/react-toggle/ for details regarding how it should be imported (specifically, the name of the import should be Toggle instead of ReactToggle it appears).

🔬 Steps to Reproduce

Simply using the ToggleButton component leads to this error being thrown when rendered.
I tested straight use of react-toggle and it works as expected when I import the library following their guidance in the documentation linked above.

🔥 Exception or Error


React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

🌍 Your Environment

Version:


"react": "^16.14.0",
"react-dom": "^16.14.0",

Anything else relevant?

@avkvirtru
Copy link
Contributor

Pending larger discussion about using an existing React component library as the underpinnings of the Virtuoso Design System.

@avkvirtru
Copy link
Contributor

FYI @kuguarpwnz worked on the original Toggle component in virtru/react-components https://github.com/virtru/react-components/commits/master/lib/components/ToggleButton

We can revisit this when we've decided on the React component library.

@kuguarpwnz
Copy link
Contributor

Still works well when I import it from react-components. Should be easily fixed by changing the way it's imported. Please see aaronshaf/react-toggle#97

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

3 participants