Code Monkey home page Code Monkey logo

graphql-recipefinderclient's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @Dameon1
  • ๐Ÿ‘€ Iโ€™m interested in ... Data Availabilty
  • ๐ŸŒฑ Iโ€™m currently learning ... Atomic Asset Distribution
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on ... Anything Arweave Related
  • ๐Ÿ“ซ How to reach me ... dameon.eth dameon1.ar dameon.lens @damon_h2o

graphql-recipefinderclient's People

Contributors

dameon1 avatar dependabot[bot] avatar

Watchers

 avatar

graphql-recipefinderclient's Issues

Make key unique

const results = data.fetchRecipesFromSpoonacularInBulk.map((recipe,i) => <UserDisplayedRecipes props={recipe} key={i}>{recipe.title}</UserDisplayedRecipes>);

You'll want to make all React keys unique on the data and not the index. For instance, say you have a collection (array of objects) with 3 objects. Those objects give an accordion menu with states opened and closed.

const ourCollection = [{ name: "Fluffykins"}, {name: "Fido"}, {name: "Carl"}]

In the local component React state, Fluffykins is closed, Fido is open, and Carl is closed.

Now suppose that new data comes in and Fluffykins is removed. What happens to the Accordion?

Expected: Fido open, Carl closed.
What happens when you use indexes for keys: Fido closed, Carl open.

React knows that 1 and 2's keys are the same (0 and 1), so it will simply pass the data into those existing elements.

Does that make sense? There are a host of other bugs that can happen too.

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.