Occasionally I come across a case where multiple components have the same or near-identical props & script logic, but their display is so different that using conditional logic in the template
doesn’t really make sense.
For example, right now I have a case where I’m rendering metrics in different parts of an application with different visual appearance, but the processing logic in each of the components is pretty much identical.
What is the best pattern for code re-use here?
- Pushing the logic into a composable?
- Some kind of system for dynamic template selection?
- Something else I haven’t thought about?