Giter Club home page Giter Club logo

react-list-keys's Issues

Make undocumented `keyNo` private

The undocumented keyNo object property on ReactKeyGen instances is exposed and serves no good purpose to the end user atm other than maybe causing bugs

Key solution for primitives

There are many types of things in lists that you might want to generate keys for, not just objects -- primitives like string or integer as well. Right now it's possible to use the string or integer as a key because they are primitives BUT in something like a to-do list or list of text messages, you must first wrap it in an object if you want the lists to have duplicate values, which in these cases they very well might.

An idea is to add a wrapper or something over a primitive list to generate keys or something for primitive list items. One solution might be to have a key as a string with something dumb like ${value}${indexInList} but that kinda defeats the whole purpose of handling keys properly. Another solution that might work is to wrap the primitives in an object with its valueOf() returning the primitive value, and then adding a _key property.

Primitive support should include at least:

  • Strings
  • Numbers

Optional support could be added for:

  • Booleans

Docs: Syntax Highlighting on NPM

NPM currently does not syntax highlight the code example. Changing the script body to 'javascript' instead of 'node' might help.

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.