Giter Site home page Giter Site logo

Comments (6)

Razem avatar Razem commented on June 5, 2024

I've just gotten the exact same error for the exact same reason. It would be really cool if we had support for Immutable.js since lots of people use it in their projects.

from rapscallion.

kitten avatar kitten commented on June 5, 2024

Have you tried calling “.toArray()” after “.map”, otherwise React will use immutable’s iterables which rapscallion probably doesn’t support

from rapscallion.

Razem avatar Razem commented on June 5, 2024

@philpl Sure, it worked. But since React supports Immutable lists, I would expect the same from Rapscallion.

from rapscallion.

ryan-roemer avatar ryan-roemer commented on June 5, 2024

To help my understanding of the changes involved, can someone point me to how React handles things or a pseudo-code diff of what the changes would involve to be immutable-compatible?

from rapscallion.

divmain avatar divmain commented on June 5, 2024

Hi @wayweary. Can you provide a reduced repro that I can work against? This should definitely be addressable, but it'll be easier if I start without having to recreate your broken experience. @Razem, feel free to jump in, too :)

from rapscallion.

Razem avatar Razem commented on June 5, 2024

@divmain Here is an example: https://github.com/Razem/rapscallion-immutable-test

As you can see, it can be successfully rendered using the ReactDOMServer.renderToString method, but Rapscallion fails to recognize Immutable objects as iterables.

I believe the problem is somewhere in src/render/traverse.js.

Also note that since React 16, keys are also rendered for Immutable maps. Which is not happening in React 15. So {testMap.map((item, key) => (<span key={key}>{item} </span>))} would actually render a<span>Hello </span>b<span>World </span> instead of just <span>Hello </span><span>World </span>. But since the Rapscallion is focused on React 15, it should probably render the output wihout the keys.

from rapscallion.

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.