Skip to content

Foundation: 'as' Props #8334

@JasonGore

Description

@JasonGore

Revisit as props in Slot context.

  • First Step
    • Start with support for instrinsic-only root elements.
  • Reconcile the meaning of as props
    • Intrinsic components vs. React components
    • Root elements vs. subcomponents.
  • Type Safety
    • Concern of intrinsic attributes not lining up
    • Could make string for use with getNativeProps for type safety
    • React Router case?
  • This CodePen identified a scenario where an titleAs prop would be significantly simpler than the approach highlighted in the CodePen.
    • Should slots allow for as props somehow?
    • Should children in this instance be render components?
  • Render JSX / Function as replacement
    • How would slot shorthand props be passed?
    • How would slot props objects be passed?
    • How could replacement get specialized props?
    • Could a customized title render function be encapsulated inside a new CollapsibleSection component that just takes in shorthand/props externally?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions