Writing reusable React components can be difficult due to the need of custom appearance and behavior. As components authors we can achieve this by leaving the actual rendering of HTML/CSS to the component’s user. In this talk, Yakir Narkis shows a real life use case and code of a React component that don’t own rendering. Yakir shows advanced code patterns for writing React components that implement a concept called Inversion of Control, in order to achieve code reusability while keeping an easy to use API.
You can find the sample code here https://codesandbox.io/s/vmv86zom85.
For more engineering updates and insights:
Follow us on Twitter → / wixeng
Subscribe our monthly newsletter → https://www.wix.engineering/subscribe
Visit our blog → https://www.wix.engineering/blog
Follow our Medium publication → / wix