Skip to content

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

@mellis3

Description

@mellis3

I'm probably doing it wrong, so i need some guidance please!

Here's what i'm doing:
import * as ResponsiveImage from 'react-simple-image';

let imageTest = <ResponsiveImage
alt='example'
className='additional-className'
src='example-small.png'
srcSet={{
'360w': 'example-small.png',
'720w': 'example-middle.png',
'1200w': 'example-large.png'
}}
sizes={[
{ size: '100vw', mediaCondition: '(max-width: 30em)' },
{ size: '50vw', mediaCondition: '(max-width: 50em)' },
{ size: 'calc(33vw - 100px)' }
]}
/>;

Then i get the error about it expecting a string or class.
What am i doing wrong? Am i importing it correctly?

Thanks for your assistance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions