Component Driven Emit Chain
I have a question. I'm trying to follow Component Driven Development https://www.componentdriven.org/. If I understand it correctly, it recommends keeping data binding at the page level or higher. Now, to follow that, I'm having to pass certain actions into deep child components with multiple emits and if I'm passing functions that need arguments, I'm also required to create multiple functions in the script tag to handle arguments during emits. I know I can avoid a lot of prop drilling and emits by using
useState
and accessing states in child components directly. But I'm afraid that will not let my components stay presentational, testable and reusable.
So, my question is how can I get the best of both worlds? How can I keep my components simple, presentational, testable and reusable at the same time avoid prop drilling and emit
chains?0 Replies