Learn how to implement route-based and component-based code splitting using the React.lazy function. Dynamically import components only when they are rendered.