Thanks again for another great article. The same one but for iOS was also great but why making same app in two (iOS and Android) ways if RN is cross-platform?
Wouldnât it make more sense to demo that cross-platform ability by making this same app supporting both Android and iOS in one single project?
It would help a lot learn how to write cross-platform code in react-native to beginner like me.
Much appreciated
@dbnex14 Simple reason is the iOS tutorial was written first. This Android one is truly cross-platform. The iOS one has aspects that only work on that platform. You can decide which way you want to go. When writing the Android tutorial there was a thought to combine both, but it was decided to keep them separate.
~âMost other UI frameworks put the onus on you to update the UIâ. Actually, Architecture Components take care of all that for you on android. You can easily implement a uni-directional data flow with a âsingle source of truthâ on androidâŠ
Thanks for the awesome article! Iâm starting with React Native, and your article was the best start Iâve found. About this project being cross-platform, can you give me your thoughts about what is the best approach to start an app with this premise: using react-native (like you did on this article), or create-react-native-app and expo?
@edumelzer, if youâre starting off. Go with create-react-native-app and expo. It gets you up and running without needing Xcode or Android Studio which can be a pain if youâre new to those environments. Once you get the hang of how React Native works and you feel the need to branch out into using more native hooks, you can switch your project to all native.
Thanks fro the tutorial.
Unless because I am smoking something but I find the Adding Navigation section confusing, it doesnât specify that you have to create a new Search Page on that section before you will be able to see the screen with the Title bar that says Property Finder. And you need the SearchPage in order for the StackNavigator home screen.
You may have missed the part that says âNext, replace the App class definition with the following:â and right after that the SearchPage class is defined. If Iâm misunderstanding what youâre asking let me know.
Iâm not sure if there is an error in the code or something I missed. I am getting the following error after adding the final styling and ListItem class. I have attached a screenshot of the error. I downloaded the source zip and replaced the App.js, SearchPage.js, and SearchResults.js with the source files and got the same result. Any ideas why this is happening?
Thanks @cabernathy and @Joe Howard for the such useful article for beginners. I try with my self and it quite amazed the way you guys explain the things. I just mention the one thing related to fetch method.
I just follow the instruction as you guys mention, but i was getting one error that json.response undefined.
I get worried that where i get wrong. So read two or three times the article but i was unable to resolve the issue. After spend some time on google i will find the answer of my problem âjavascript - React Native: Unhandled promise rejection: TypeError: undefined is not an object (evaluating 'response.json') - Stack Overflowâ.
If some one facing same problem that i go through please use the given fetch method.
" fetch(query)
.then(response => {
console.log(âresponse:â,response.status)
return response.json().then(data =>{
this._handleResponse(data.response)
})
})
.catch(error =>
this.setState({
isLoading: false,
message: 'Something bad happened â + error
})); ".
Thanks once again @cabernathy and @Joe for such useful article.
fetch(query)
.then(response => response.json()) // status may not be ok, but promise not rejected
.then(json => this._handleResponse(json.response)) // json possibly undefined
.catch(error =>
this.setState({
isLoading: false,
message: 'Something bad happened ' + error
}));
To:
fetch(query)
.then(response => {
if (response.ok) {
return response.json();
}
throw new Error('Network response was not ok.');
})
.then(json => this._handleResponse(json.response))
.catch(error =>
this.setState({
isLoading: false,
message: 'Something bad happened ' + error
}));
Thanks again for another great article. also we are leaders in React Mobile app Development, can anyone contact us to any query regarding code, our developer can happy to assist you.