title: how to return json file to React
body: <p>There is json in the project which contains the data that I need to display in the component. How to correctly access the json file in react and output data from json?</p>
  
  <p>data.json</p>
  
  <pre><code>{
    "dictionary": [
      {
        "index": "1",
        "engwords": "Hello",
        "ruswords": "Привет"
      },
      {
        "index": "2",
        "engwords": "How are you?",
        "ruswords": "Как твои дела?"
      },
      {
        "index": "3",
        "engwords": "How old are you?",
        "ruswords": "Сколько тебе лет?"
      }
    ]
  }
  </code></pre>
  
  <p>component.js</p>
  
  <pre><code>import React, {Component} from "react";
  import "./style.scss";
  const dictionary = require ('./../../dictionary/dictionary.json');
  
  export default class Test extends Component {
      render() {
          return (
              &lt;div className="test"&gt;
                  {dictionary.map(elem =&gt; (
                      &lt;p&gt;{elem}&lt;/p&gt;))}
              &lt;/div&gt;
          );
      }
  };
  </code></pre>