-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
Description
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?
- Should slots allow for
- 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?