Giter Club home page Giter Club logo

moviegallery's People

Contributors

kenlaam avatar

Watchers

 avatar  avatar

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 replace Promise 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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.