You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed the guide and attempted to use the CommonJS import: const Toggle = require('react-toggle')
And got these 2 errors:
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of StatelessComponent.
Which could be resolved by changing the import: const Toggle = require('react-toggle').default
or adding module.exports = Toggle;
to index.js.
The text was updated successfully, but these errors were encountered:
Hello,
I followed the guide and attempted to use the CommonJS import:
const Toggle = require('react-toggle')
And got these 2 errors:
Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of
StatelessComponent
.Which could be resolved by changing the import:
const Toggle = require('react-toggle').default
or adding
module.exports = Toggle;
to index.js.
The text was updated successfully, but these errors were encountered: