Monthly Archives: February 2018

Angular-like multi slot transclusion in React

I would like to share here a method, which I use for children passing to ‘slots’. Say, for example, you need to develop menu with different backgrounds for menu items: <div class=”my-menu-parent”> <div class=”my-menu-item-red”> <a href=”#”><img src=”http://fullhdwall.com/wp-content/uploads/2016/09/Best-World.jpg” /></a> </div> <div class=”my-menu-item-yellow”> <span>My second menu item</span> </div> <div class=”my-menu-item-blue”> <span>My Blue menu item</span> </div> </div To […]