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

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

Open
mellis3 opened this issue Feb 6, 2018 · 1 comment

Comments

@mellis3
Copy link

mellis3 commented Feb 6, 2018

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

@filipdanisko
Copy link

Try import like this import ResponsiveImage from "react-simple-image";

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

2 participants