Code Monkey home page Code Monkey logo

Comments (3)

prakhar1989 avatar prakhar1989 commented on July 20, 2024

One of the reasons why this error / warning is being generated is due to the mapping over the Immutable collection. I tried isolating the issue on the minimap and this is what I've found - http://stackoverflow.com/questions/31195321/immutable-js-mapping-over-keys-in-safari.

from react-surveyman.

jvilk avatar jvilk commented on July 20, 2024

Hmm? The React warning in your SO post makes sense.

Any use of a keyed object should be wrapped in React.addons.createFragment(object) before being passed as a child.

    var items = Immutable.fromJS([
      {id: 1, val: "foo"},
      {id: 2, val: "bar"},
      {id: 3, val: "moo"},
      {id: 4, val: "baz"}
    ]);

    var tree = items.map(function(item, i) {
      // This is a keyed object. https://facebook.github.io/react/docs/create-fragment.html
      return <p key={i}>{item.get('val')}</p>
    });
    // Tree is composed of keyed objects.

    return (
        // You are making tree a child of div. Tree is composed of keyed objects. Therefore, you are passing
        // a keyed object as a child of this div without wrapping it in createFragment.
        <div className="tree-view">
            {tree}
        </div>
    )

from react-surveyman.

prakhar1989 avatar prakhar1989 commented on July 20, 2024

@jvilk: Right.. but the mapping over Immutable sequences should only pick up the elements and not the object properties. Weirdly, I'm unable to replicate this in jsbin.. so some issue in the application only. Somehow, this is working fine in Chrome / Firefox.

from react-surveyman.

Related Issues (20)

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.