title: reactjs, const, passing properties
body: <p>I am new to react and taking over a piece of emergency work. I have a component which is invoked on the index page and I am trying to push an object property into it.</p>
  
  <hr>
  
  <p>so there are two methods here of doing this</p>
  
  <pre><code>const TestBundle = ({lang}) =&gt; (
    &lt;section className='relative-container'&gt;
      &lt;div className='row'&gt;
          {lang}
      &lt;/div&gt;
    &lt;/section&gt;
  )
  
  TestBundle .propTypes = {
    lang: React.PropTypes.object.isRequired
  }
  </code></pre>
  
  <p>^ this works.. but how do I get this next concept to work properly - when I tried this solution I had all sort of errors.</p>
  
  <pre><code>const TestBundle = (props) =&gt; {
      const lang = props.lang
  
        &lt;section className='relative-container'&gt;
          &lt;div className='row'&gt;
              {lang}
          &lt;/div&gt;
        &lt;/section&gt;
  }
  </code></pre>
  
  <p>//different example</p>
  
  <pre><code>const TestBundle = (props) =&gt; {
      const lang = props.lang
  
        &lt;section className='relative-container'&gt;
          &lt;div className='row'&gt;
              {lang}
          &lt;/div&gt;
        &lt;/section&gt;
  }
  
  export default TestBundle
  </code></pre>
  
  <p>-- but this comes up with the error </p>
  
  <pre><code>./src/components/Services/TestBundle.js
  Module build failed: SyntaxError: D:/wamp/www/project/react/src/components/Services/TestBundle.js: Unexpected token (5:2)
  
    3 | 
    4 | const TestBundle= (props) =&gt; {
  &gt; 5 |   const lang = props.lang
      |   ^
    6 |   
    7 |   &lt;section className='relative-container'&gt;
    8 |     
  </code></pre>