GithubHelp home page GithubHelp logo

hooks-movie-app's Introduction

Hooks Movie App

This is the demo application using React Hooks!!!

The article containing instructions on how to build this app can be found here

Getting Started

These instructions should get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Things you need to get started:

Installing

To get the project running, follow these steps:

  • Create a folder -Enter/Navigate into that folder
cd <folder-name>
  • Clone this repository:
git clone https://github.com/samie820/hooks-movie-app.git
  • Install all the project's dependencies:
yarn or npm install
  • Once that's done, run the project:
npm start or yarn start

Deployment

The app can be deployed using either heroku or Netlify

Built With

  • Javascript
  • React - (UI library)

Contribution

Please read the CONTRIBUTING.md file (Soon to be added) to see how you can contribute and add more features to the project.

Authors

TODO: Add the Authors

hooks-movie-app's People

Contributors

afozbek avatar samie820 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hooks-movie-app's Issues

onKeyUp instead of onChange in Search.js?

A great tutorial at the right time. I tried onKeyUp in the section
<input value={searchValue} onChange={handleSearchInputChanges} type="text" /> to see if the results could be dynamically modified as you type and to avoid use of the Search button, but the input field then does not accept input. Any way to get this to work? Thanks

Uncaught TypeError: Cannot read property 'map' of undefined

Hello,

I noticed you have the following error message when you launch the project for the first time.

Uncaught TypeError: Cannot read property 'map' of undefined

It seem that you perform an axios() request on MOVIE_API_URL which doesn't necessary return an array you .map() on.

const App = () => {
  const [state, dispatch] = useReducer(reducer, initialState);

  useEffect(() => {
    axios.get(MOVIE_API_URL).then(jsonResponse => {  // **(1)**
      dispatch({
        type: "SEARCH_MOVIES_SUCCESS",
        payload: jsonResponse.data.Search
      });
    });
  }, []);

(1): return an object. However you're looking for an array to be able to use map()

const retrievedMovies =
   loading && !errorMessage ? (
     <img className="spinner" src={spinner} alt="Loading spinner" />
   ) : errorMessage ? (
     <div className="errorMessage">{errorMessage}</div>
   ) : (
     movies.map((movie, index) => ( // **it will crash here**
       <Movie key={`${index}-${movie.Title}`} movie={movie} />
     ))
   );

So my suggestions are

  • Either you completely remove the useEffect() at the beginning of the App() component and thus display an "empty" page (without the preview of the available movie)

-Or you can perform an axios() request to another endpoint. Basically display a list of movie (not a random list) but display the result of a default search.

e.g https://www.omdbapi.com/?s=AVENGER&apikey=4a3b711b

(display a list of movie related to the Avenger instead of leaving a blank page and waiting for the user to perform his own research)

Do you want me to open a pull request ?

Store Management

If store management is inside store folder maybe other developers understand the code much better. I added the improvements and if you approve the changes you can close this issue.

Thanks

can you host this..

hey plz can you host this ? coz i want to see this .. and as i am learnings react js so it'd helpfull.

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.