Skip to content
Advertisement

When trying to use Card of Reactstrap I get Warning: React.jsx: type is invalid — expected a string (for built-in components) or a class/function?

I tried to import the Card component from the Reactstrap library, and unfortunately this has resulted in the error below.

JavaScript

When I remove the element, the page works again as intended.

IMPORTS (IN PROFILE COMPONENT):

JavaScript

EXPORT (AT BOTTOM OF PROFILE COMPONENT):

JavaScript

In APP.js router:

JavaScript

Full Profile component:

JavaScript

Advertisement

Answer

I think you might not have read reactstrap’s docs closely enough – the component should be CardBody, not Card.Body. Here’s a link to the docs, and a simplified CodeSandbox.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement