Posts

Showing posts from January 29, 2019

when this.props is passed to the child component, it becomes undefined

Image
0 My React project component structure is very simple: App >> SearchResults >> TrackList. To test, I output the value of the data in each component. In the App.js file, I used this.state to define an array of objects called searchResults . class App extends React.Component { constructor(props) { super(props); this.state = { searchResults: [ { name: 'name-1', artist: 'artist-1', alblum: 'alblum-1', id: 101 }, { name: 'name-2', artist: 'artist-2', alblum: 'alblum-2', id: 202 } ] } } render() { console.log('Here is App.js', this.state.searchResults); return ( <div>

Different results from “Android Logcat” and “Postman” both with status 200 OK

Image
0 I am getting different results from android logcat and postman response for the same GET request, as shown below: Android Logcat request: D/OkHttp: --> GET http://companyname.com/api/Sales/FetchOrderRequestCompetitor? Id=5737&Type=B&CategotyId=&BrandId=&CustomerId= http/1.1 Authorization: BA5BA5DC-8147-4924-9BCA-558508 X-User-Id-1: 4J6333gM4cXhX+Rv4h7qsw== Connection: close --> END GET Android Logcat Response: Response: {"CompetitorProducts": [{"CompetitorId":"C13","CompetitorName":"Computer","ReturnRqst": [{"ProductId":"3030","ProductName":"ProductA","Quantity":"","Amount":"0.00","DiscountPercentage":"0"},{"Prod