title: How to setState in react.js using "binance.futuresMiniTickerStream()" function
body: <p>When I do this It works</p>
  <pre><code>import React, { useState, useEffect } from 'react'
  
  // Node Binance API
  // https://github.com/binance-exchange/node-binance-api
  
  const Binance = require('node-binance-api')
  const binance = new Binance().options({
    APIKEY: 'xxxxxxxxxx',
    APISECRET: 'xxxxxxxxxx'
  })
  
  // BTCUSDT - price
  const FuturesPrices = () =&gt; {
  
    const [btcPrice, setBtcPrice] = useState([])
  
      useEffect(() =&gt; {
  
        async function fetchMyAPI() {
  
          let response = await binance.futuresPrices()
  
          response = response.BTCUSDT
  
          setBtcPrice(response)
  
          //console.log(response)
        }
  
        fetchMyAPI()
  
      }, [btcPrice])
  
      return &lt;div&gt;{btcPrice}&lt;/div&gt;
  
  }
  
  export default FuturesPrices
  </code></pre>
  <hr />
  <p>But when I try example down below It doesn't work. Gives &quot;error
  Unhandled Rejection (Error): ws does not work in the browser. Browser clients must use the native WebSocket object&quot;</p>
  <pre><code>import React, { useState, useEffect } from 'react'
  
  // Node Binance API
  // https://github.com/binance-exchange/node-binance-api
  
  const Binance = require('node-binance-api')
  const binance = new Binance().options({
    APIKEY: 'xxxxxxxxxx',
    APISECRET: 'xxxxxxxxxx'
  })
  
  // BTCUSDT - price
  const BtcPriceTicker = () =&gt; {
  
    const [btcPriceTicker, setBtcPriceTicker] = useState([])
  
      useEffect(() =&gt; {
  
        async function fetchMyAPI() {
  
          let response = await binance.futuresMiniTickerStream( 'BTCUSDT' )
  
          response = response.close
  
          setBtcPriceTicker(response)
  
          //console.log(response)
        }
  
        fetchMyAPI()
  
      }, [btcPriceTicker])
  
      return &lt;div&gt;{btcPriceTicker}&lt;/div&gt;
  
  }
  
  export default BtcPriceTicker;
  
  </code></pre>
  <p><em>My GitHub
  <a href="https://github.com/React-Binance/react-binance-api" rel="nofollow noreferrer">https://github.com/React-Binance/react-binance-api</a>
  Contribute to React-Binance/functional components development</em></p>