-
Notifications
You must be signed in to change notification settings - Fork 790
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
Feature Request : @Props OR component inheritance #2844
Comments
We WOULD LOVE THIS KIND OF FEATURE AS WELL! |
Hey guys :) |
I will be submitting a PR which should solve this issue :) - just as soon as my source maps branch gets merged as source maps would be helpful. |
@johnjenkins that would be amazing. |
Yep, nearly there. Just writing tests |
Ok, if anyone get a chance, I'd urge you to take a look and try it out :) |
Component inheritance is really a foundational feature IMHO. Also there are several already-closed issues to this exact topic (starting from 2017, nearly 5 years ago). Will this have a chance to arrive in stencil or is it considered as "won't fix"? |
Hi
Thank you for your wonderful job, we are one of your biggest supporters, here in Australia :)
I'm writing to get help or perhaps if possible get this feature natively.
We're developing a design system with Stencil , however ,since StencilJS doesn't support component inheritance, we're finding it very limiting when it comes to reusing our internal code base.
Use Case :
Create a bunch of icon components that each represent one icon element, but they all share similar props :
Component 1 :
Component 2 :
Each of above component accepts a series of similar props, like
color
,size
,shape
and passes all those props to an internal component which has the SCSS file which does the actual magic .Each of above components would look like below
This pattern has been heavily used in React Material design, https://material-ui.com/components/material-icons/
We have hundreds of these icons and we have to repeat these props inside every single one of them.
Is there any way we could avoid this ?
Ideally, it would be nice if there was a
@Props() allProps
decorator which would contain all the props.With
Props
, we could do something like this :Or at least allow us to use inheritance to achieve something like this :
We look forward to hearing from you.
Cheers
The text was updated successfully, but these errors were encountered: