Skip to content

Introduce <ListIterator> #10830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 9, 2025
Merged

Introduce <ListIterator> #10830

merged 3 commits into from
Jul 9, 2025

Conversation

djhi
Copy link
Collaborator

@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
@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
Development

Successfully merging this pull request may close these issues.

2 participants