title: Is it good to use package.json file in react component file?
body: <p>I have to use version mentioned in package.json file in front-end(react js) file.</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;name&quot;: &quot;asdfg&quot;,
    &quot;version&quot;: &quot;3.5.2&quot;, // want to use this
    &quot;description&quot;: &quot;description&quot;,
    &quot;scripts&quot;: {}
    //etc etc etc
    ......
  }
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/39706216/send-package-json-version-to-angularjs-front-end-for-display-purposes">Send package.json [version] to Angularjs Front end for display purposes</a></p>
  <p>I'd gone through above post and found two ways for the same. but none of them I was asked to implement.</p>
  <p>#1. During build process</p>
  <p>#2. By creating endpoint</p>
  <p>So I want to know the approach below is valid/good or not ?</p>
  <p>react-front-end-file.js</p>
  <pre><code>import packageJson from '../package.json'; // imported
  ...
  ...
  // Usage which gives me version - 3.5.2
  &lt;div className='app-version'&gt;{packageJson.version}&lt;/div&gt; 
  </code></pre>
  <p>Let me know if this approach is fine.</p>