4 ms·
I am skeptical about "component knows what data it needs". For example, I have a component with two combo boxes: in the first combo box I select a country and t
by avodonosov 11y ago
I am skeptical about "component knows what data it needs". For example, I have a component with two combo boxes: in the first combo box I select a country and the second combo box is filled with cities of that country.
Now I need a similar thing: in one combo box I choose car brand, and the second combo box is filled with models of that brand. Can I reuse my existing component? If the component knows what data it displays, it can not be used to display different data.
- Skinney 11y agoIf you need a generic component, then make a generic component. No one is forcing you to specify dependencies in all of your components.
- avodonosov 11y agoOK :)
- jeremiep 11y agoDavid talked about the IQueryParams protocol in the presentation, it basically lets you parametrize the component's data.