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

[bug]: Components using as prop do not have said prop's components inferred #1401

Closed
joshuaellis opened this issue Oct 13, 2023 · 1 comment · Fixed by #1695
Closed

[bug]: Components using as prop do not have said prop's components inferred #1401

joshuaellis opened this issue Oct 13, 2023 · 1 comment · Fixed by #1695
Assignees
Labels
issue: bug Issue reporting a bug source: design-system relates to design-system package
Milestone

Comments

@joshuaellis
Copy link
Contributor

What version of strapi-design-system are you using?

  • DS version: 1.12.0

What's Wrong?

When you use the as prop on something like NavLink to change it to use the react-router Link component the props are not correctly inferred:

<NavLink
  as={RouterNavLink}
  to={link.to}
>
	link
</NavLink>

so to claims to not exist, even though it should.

To Reproduce

remove the TS directive from this link in the main repo to see the issue:

https://github.com/strapi/strapi/blob/main/packages/core/admin/admin/src/components/LeftMenu.tsx#L185

Expected Behaviour

The props from the ElementType passed as the as prop should be added to the props of the entire component

@joshuaellis joshuaellis added issue: bug Issue reporting a bug source: design-system relates to design-system package labels Oct 13, 2023
@joshuaellis joshuaellis linked a pull request Apr 30, 2024 that will close this issue
@joshuaellis joshuaellis self-assigned this Apr 30, 2024
@joshuaellis joshuaellis added this to the v2.0.0 milestone Apr 30, 2024
@joshuaellis
Copy link
Contributor Author

solved by #1695

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug source: design-system relates to design-system package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant