I am new to lightning and i just dont get renderer. Why do we use it? Can please anyone tell me with example. I get the part that salesforce automatically renders if some data is changed. But why use after that?
We have dozens of components and none of them have a renderer. Most of the time you don't need to have one so don't concern yourself until you find a reason to add one. And in my experience, when you think you have a reason, an alternative solution might well be cleaner: best to leave the DOM manipulation to the framework and work with components not DOM elements.
The documentation says:
You don’t normally have to write a custom renderer, but it’s useful when you want to interact with the DOM tree after the framework’s rendering service has inserted DOM elements. If you want to customize rendering behavior and you can’t do it in markup or by using the init event, you can create a client-side renderer.