Skip to content

Introduce <ListIterator>#10830

Merged
slax57 merged 3 commits intonextfrom
list-iterator
Jul 9, 2025
Merged

Introduce <ListIterator>#10830
slax57 merged 3 commits intonextfrom
list-iterator

Conversation

@djhi
Copy link
Copy Markdown
Contributor

@djhi djhi commented Jul 7, 2025

Problem

Rendering a custom list is cumbersome. One has to create an iterator component that reads the list context.

The <SingleFieldList> is a good tradeoff, as one can just use a component that reads a RecordContext and it will be displayed several times.

But it’s tied to MUI, so we can’t use it in other UI kits.

Solution

Add a <ListIterator> component, that simply iterates over data, creates a RecordContext, and renders its child n times. It shouldn’t render any wrapper, to let users choose the wrapper of their choice (e.g. <ul>)

It should render either children or a render prop

TODO

  • Implementation
  • Tests & Stories
  • Update <SingleFieldList> and <SimpleList>
  • Documentation

How To Test

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@djhi djhi added RFR Ready For Review and removed WIP Work In Progress labels Jul 8, 2025
@slax57 slax57 self-requested a review July 9, 2025 08:27
Comment thread docs/ListIterator.md Outdated
Comment thread docs/ListIterator.md Outdated
Comment thread docs/ListIterator.md
Comment thread docs/ListIterator.md Outdated
@slax57 slax57 added this to the 5.10.0 milestone Jul 9, 2025
@slax57 slax57 merged commit 1bd04dd into next Jul 9, 2025
15 checks passed
@slax57 slax57 deleted the list-iterator branch July 9, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants