mantaskaveckas / react-siema

ReactSiema Demo
https://kaveckas.github.io/react-siema/
89 stars 39 forks source link

Invariant Violation - #18

Open mattymakalu opened 6 years ago

mattymakalu commented 6 years ago

Running gatsby build and getting this 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 Siema

My siema.js component:

`import React from 'react' import ReactDOM from 'react-dom' import ReactSiema from 'react-siema' import Banner1 from '../components/banners/banner1.jpg' import Banner2 from '../components/banners/banner2.jpg'

class Siema extends React.Component {

render() {

    const Slide = (props) => <img {...props} alt="slide" />
    let slider;

    return (

        <section className="banner">

            <ReactSiema ref={siema => slider = siema}>
                <Slide src={Banner1} />
                <Slide src={Banner2} />
            </ReactSiema>

            <div className="slider--nav tac mdt">

                <div className="slider--nav__item dib" onClick={() => slider.goTo(0)}></div>
                <div className="slider--nav__item dib" onClick={() => slider.goTo(1)}></div>

            </div>

        </section>

    )

}

}

export default Siema ` And the error...

`See our docs page on debugging HTML builds for help https://goo.gl/yL9lND

27 | message += ' for the full message or use the non-minified dev environment' + ' for full errors and additional helpful warnings.'; 28 |

29 | var error = new Error(message); | ^ 30 | error.name = 'Invariant Violation'; 31 | error.framesToPop = 1; // we don't care about reactProdInvariant's own frame 32 |

WebpackError: Minified React error #130; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=130&args[]=object&args[]=%20Check%20the%20render%20method%20of%20%60Siema%60. for the full message or use the non-minified dev environment for full error s and additional helpful warnings.`

Any help massively appreciated.