title: Sorting a list of fund names alphabetically within a React component
body: <p>I'm trying to make the fund names in the following component alphabetically sortable...So value1 = fund1, value2 = fund2, etc should render in an alphabetical order. At the moment the order is miscellaneous.</p>
  
  <p>Can someone suggest how I can change the following code to achieve this?</p>
  
  <p>Thanks!</p>
  
  <pre><code>'use strict'
  
  import watchlistProxy from 'common/watchlist-proxy'
  
  export default function (groups, propName, isAscending) {
    if (!groups.length) {
      return
    }
  
    const sortBaseValue = isAscending ? 1 : -1
  
    const sortHandler = propName === 'favourite' ? (fund1, fund2) =&gt; {
      const value1 = watchlistProxy.hasFund(fund1.isin)
      const value2 = watchlistProxy.hasFund(fund2.isin)
      return value1 === value2 ? 0 : value1 ? -sortBaseValue : sortBaseValue
    } : (fund1, fund2) =&gt; {
      const value1 = fund1.sortingValues[propName]
      const value2 = fund2.sortingValues[propName]
      if (value1 === value2) {
        return 0
      }
      return value1 &lt; value2 ? -sortBaseValue : sortBaseValue
    }
  
    groups.forEach(group =&gt; {
      group.funds.sort(sortHandler)
    })
  }
  </code></pre>