moviegallery's People
moviegallery's Issues
Thanks!
Hi, Vลฉ
Nice job with the assignment ๐
You have learned how to use basic components in React Native. You also spent lots of time for this assignment. What are the obstacles did you have when doing this assignment?
Good point:
- You used LayoutAnimation in Movie Detail. That's brilliant. There are many ways to animate in React Native you can try such as Animated, Animatable (https://github.com/oblador/react-native-animatable)
- You used
onEndReached
to fetching data next page ๐. But the data from API does not correct, it's duplicated with the previous page.
Improvements:
- Description in ListView's item does not expand based on the content because of
numberOfLines={4}
- You can use
await
to replacePromise
to make your code cleaner.
From
_fetchData() {
StatusBar.setNetworkActivityIndicatorVisible(true);
return fetch(this.state.url + this.state.page)
.then((response) => response.json())
.then((responseJson) => {
this.setState({
page: this.state.page++,
movieList: this.state.movieList.concat(responseJson.results),
movieDS: this.state.movieDS.cloneWithRows(this.state.movieList.concat(responseJson.results)),
refreshing: false,
});
StatusBar.setNetworkActivityIndicatorVisible(false);
})
.catch((error) => {
console.error(error);
});
}
To
async _fetchData() {
StatusBar.setNetworkActivityIndicatorVisible(true);
try {
const response = await fetch(this.state.url + this.state.page)
const responseJson = await response.json();
this.setState({
page: this.state.page++,
movieList: this.state.movieList.concat(responseJson.results),
movieDS: this.state.movieDS.cloneWithRows(this.state.movieList.concat(responseJson.results)),
refreshing: false,
});
StatusBar.setNetworkActivityIndicatorVisible(false);
} catch (error) {
console.error(error);
}
}
One more thing, how do you feel when working on React Native compared with Android Native?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.