title: Switching from MVC to React. How do I write React correctly so that a table from the database is drawn on the page?
body: <p>Prompt when worked through MVC that created Models then controllers and returned them to Razor for display. Everything worked. Now you need to write an application in .Net Core + React. I don't understand how to pass a value to it for display.</p>
  <pre><code>public class TableController : Controller
  {
  
      List&lt;TableInfo&gt; tableInfo = new List&lt;TableInfo&gt;();
      public IActionResult Index()
      {
          using OracleConnection conn = DBUtils.GetDBConnection();
          using OracleCommand cmd = new OracleCommand($&quot;select ID, IP from updater_srv&quot;, conn);
  
          conn.Open();
  
          using (OracleDataReader dateReader = cmd.ExecuteReader())
          {
  
              while (dateReader.Read())
              {
                  tableInfo.Add(new TableInfo
                  {
                      ID = Convert.ToString(dateReader.GetValue(0)),
                      IP = Convert.ToString(dateReader.GetValue(1)),
                  });
              }
          }
          return View(tableInfo);
      }
      [HttpGet]
      public IEnumerable&lt;TableInfo&gt; Get()
      {
          return tableInfo;
      }
  </code></pre>
  <pre><code>import React, { Component } from 'react';
  
  export class Table extends Component {
      static displayName = Table.name;
  
            constructor(props) {
                  super(props);
            }
  
      componentDidMount() {
          axios.get('url').then(resopnse =&gt; {
              this.setState({ data: response })
          })
      }
      render() {
          return (
              &lt;div&gt;
                  &lt;table&gt;
                      &lt;thead&gt;
                          &lt;th&gt;ID&lt;/th&gt;
                          &lt;th&gt;IP&lt;/th&gt;
                      &lt;/thead&gt;
                      &lt;tbody&gt;
                          this.state.data.map(item =&gt; { 
                        return (
                          &lt;tr&gt;
                              &lt;td&gt;{item.ID}&lt;/td&gt;
                              &lt;td&gt;{item.IP}&lt;/td&gt;
                          &lt;/tr&gt;
                            );
                          }
                      &lt;/tbody&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
          );
      }
  }
  </code></pre>
  <p>How do I write React correctly so that a table from the database is drawn on the page?</p>