Hacker News new | ask | show | jobs
by gurgus 3448 days ago
Awesome response - are you able to give me an example of what you mean "wrap third party components"?

Thanks :)

1 comments

I've done this in a project recently when I was trying out different third party autocomplete components.

I had my own autocomplete component that I would use wherever I needed an autocomplete, and that component would render the third party autocomplete and supply it with the props it required. When I needed to switch out which third party component I was using, I only had to change code in one place, instead of changing it everywhere I was using autocomplete.