Giter VIP home page Giter VIP logo

robofriends's Introduction

Robofriends

This is my first React.js project. I built it by following Andrei Neagoie teachings in the Zero To Mastery Academy. React stablishes a component focused style of development that creates a network, reducing dependencies. The library has a one way data-flow, where the direction of the data is always downstream and only the child react to changes of the parent. React describes the current state of the website with a copy of the DOM which is stored in a JavaScript object.

Following the documentation, I started the React application by typing:

npx create-react-app my-app
cd my-app
npm start

The project has four components: Card, CardList, Scroll and SearchBox. App is the container that is imported in index and rendered.

The robots are sourced from https://robohash.org/ and the names and emails are fetched from https://jsonplaceholder.typicode.com/users when componentDidMount() is run.

The class app defines a robots array and a searchfield variable. The SearchBox component receives a searchChange argument that sets the state of searchfield to the string that is written in the search box of the app. Then, as an event is triggered because something was typed in the input box, render runs again but this time a filter acts by applying the includes() method. This is passed as filteredRobots to the CardList component and now only the cards that were not filtered can be seen.

The Scroll component wraps the CardList component and applies a style to the children, which are the cards.

Try the app and find your robofriend by typing its name!

robofriends's People

Contributors

mauroarcidiacono avatar

Watchers

 avatar

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.