Replies: 4 comments
-
I'd see this as a post processing/cleaner step. When we generate the signature of the component we often don't know what plugins might need some kind of prop. We only know at the very end, when all steps did their work and no prop is used inside the component. It's also edge casey, since the components without props are just templates now. |
Beta Was this translation helpful? Give feedback.
-
I think this applies mostly in those template like components, which have no props. We can infer this from the UIDL by looking at the It's just a matter of a nice touch to not have it there, because I'm considering a lot of cases when people would play with a very simple component UIDL which has no props. But I like that idea of pre/post processing tasks in our pipeline, we should give it some thought soon This is in a way relate to #41, where I was thinking the UIDL might be validated at pre-processing, with questions like: are all the props/states declared in the interface actually used? and others of course. |
Beta Was this translation helpful? Give feedback.
-
Valid point with the validation of the UIDL, but it does not cover this case:
I still think we need to "trim" the code at the end, instead of assuming that NO PLUGIN EVER will add props where there are none. |
Beta Was this translation helpful? Give feedback.
-
OK, I see your point, removing this from the milestone for now. We should discuss a bit more about the pre/post processing tasks before moving foward |
Beta Was this translation helpful? Give feedback.
-
Currently all React components are generated with
(props) =>
in their signature. This should only be added if the component uses propsBeta Was this translation helpful? Give feedback.
All reactions