Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Make results of <Props> iterable #1375

@droganov

Description

@droganov

Branched from #1371 (comment)

I suggest to change <Props> so it would accept function child and that child could be used to manipulate rendered rows.

<Props of={UiComponent}>
  {renderedProps => children.filter(propRow => propRow.componentName === 'UiComponent')}
</Props>

We also need to inject metadata (component name and path) as a static members, to make that manipulate meaningful

({ of, children }) => {
  const result = Object.entries(of).map(renderPropAndInjectMetadata);
  return typeof children === 'function' ? children(result) : result; 
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsage question or clarification request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions