Render components based on state