1

I am trying to use this gem:

http://kyleamathews.github.io/react-component-gallery/

So I installed it using npm

npm install react-component-gallery

And I created a React component like this:

var Gallery = React.createClass({

  render: function() {
    return (

  <ComponentGallery
    className="example"
    margin=10
    noMarginBottomOnLastRow=true
    widthHeightRatio=3/5
    targetWidth=250>
      <img src="https://example.com/pic1.jpg" />
      <img src="https://example.com/pic2.jpg" />
      <img src="https://example.com/pic3.jpg" />
      <img src="https://example.com/pic4.jpg" />
      <img src="https://example.com/pic5.jpg" />
      <img src="https://example.com/pic6.jpg" />
      <img src="https://storage.googleapis.com/relaterocket-logos/[email protected]" />
      <img src="https://storage.googleapis.com/relaterocket-logos/[email protected]" />
    </ComponentGallery>
    );
  }

});

However I am getting this error:

JSX value should be either an expression or a quoted JSX t
ext (10:11)

Where line 10 is this:

margin=10

Why is this occurring?

1 Answer 1

1

JSX is XML-like. Your attribute values need to be quoted strings, expressions, or other JSX elements. In your case, e.g.

margin="10"
noMarginBottomOnLastRow={true}

(The second could be "true", just giving an example of an expression.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.