import React, { Component } from 'react';
import request from 'ajax-request';

export default class StockComponent extends Component {
  constructor(props) {
    super(props);
    this.state = {
      lastPrice: null,
      dayLow: null,
      dayHigh: null,
      dayOpen: null,
      change: null
    }
  }

  componentDidMount() {
    //Not sure how we're going to pass the stock info here
    var nse = "GOOG";
    this.makeRequest(nse);
  }

  makeRequest(nse) {
    request({
          url: `stock/${nse}`,
          method: 'GET',
          headers: {
            'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'
          }
        }, (error, response, body) => {
          const stockObj = JSON.parse(body);
          this.setStockState(stockObj);
        });
  }

  setStockState(stockObj) {
    this.setState({
      lastPrice:stockObj.LastPrice,
      dayLow:stockObj.Low,
      dayHigh:stockObj.High,
      dayOpen:stockObj.Open,
      change:stockObj.Change
    });
  }

  render() {
    //Not sure relaly how to pass proper HTML into here
    return (
      <div>
        Current Price: {this.state.lastPrice} {this.state.change}
      </div>
    )
  }
}

import React, { Component } from 'react';
import request from 'ajax-request';

export default class StockComponent extends Component {
  constructor(props) {
    super(props);
    this.state = {
      stocks: []
    }
  }

  componentDidMount() {
    //Not sure how we're going to pass the stock info here
    var nseArray = ["GOOG", "AAPL", "YHOO", "AMZN", "MSFT"];
    for (var i = 0; i < nseArray.length; i++) {
        this.makeRequest(nseArray[i]);
    }
  }

  makeRequest(nse) {
    request({
          url: `stock/${nse}`,
          method: 'GET',
          headers: {
            'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'
          }
        }, (error, response, body) => {
          const stockJson = JSON.parse(body);
          var stockObj = {
            lastPrice: stockJson.LastPrice,
            dayLow: stockJson.Low,
            dayHigh: stockJson.High,
            dayOpen: stockJson.Open,
            change: stockJson.Change
          };
          this.setStockState(stockObj);
        });
  }

  setStockState(stockObj) {
    var stocks = this.state.stocks;
    stocks.push(stockObj);
    this.setState({
      stocks: stocks
    });
  }

  render() {
    //Do what you need to make it look nice
    return (
      <div>
        Current Price: {this.state.stocks[0].lastPrice}
      </div>
    )
  }
}

Work with array of NSE values
Work with array of NSE values
