Skip to content

Typo in renderIterableBody? #36

@benny-medflyt

Description

@benny-medflyt

Hi, I was reading through the code of this library, and read the renderIterableBody function. Here is the source for it:

  const renderIterableBody = (collection, mapper, options = {}) => {
    if (options.sorted) {
      collection = collection.sortBy((value, key) => key);
    }
    const children = collection
      .map(mapper)
      .toList();

    const jsList = []
    // Can't just call toJS because that will also call toJS on children inside the list
    children.forEach(child => jsList.push(child))

    return [ 'ol', listStyle, ...children ];
  }

It seems that the author carefully crafted the jsList list, but then forgot to use it, and mistakenly used children instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions