Skip to content
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

Truncate component relies on elementType instead of as (props API inconsistency) #2986

Open
3 tasks
adamstankiewicz opened this issue Jan 5, 2024 · 0 comments

Comments

@adamstankiewicz
Copy link
Member

adamstankiewicz commented Jan 5, 2024

Improvements

Any component that allows consumers to override its underlying DOM element (e.g., div, span) should rely on an as prop for consistency with the majority of Paragon components (given most rely on react-bootstrap).

The Truncate component uses an elementType component instead of as. At least one engineer assumed as prop would work, and had to rely on the documentation to learner that Truncate uses elementType instead.

Given one of the goals of Paragon is to provide a reasonably consistent props API across components, we should ensure that any component that allows consumers to override its underlying DOM element relies on an as prop.

Tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To Do
Development

No branches or pull requests

1 participant