From ba9065c76b38be55eb91fbad5a641746092be5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Mon, 14 Aug 2023 10:52:26 +0200 Subject: [PATCH] Remark on functional vs live components --- lib/phoenix_live_component.ex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/phoenix_live_component.ex b/lib/phoenix_live_component.ex index dbb2809e2a..ed344a1405 100644 --- a/lib/phoenix_live_component.ex +++ b/lib/phoenix_live_component.ex @@ -32,6 +32,13 @@ defmodule Phoenix.LiveComponent do component. All other attributes will be available as assigns inside the LiveComponent. + > #### Functional components or live components? {: .neutral} + > + > Generally speaking, you should prefer functional components over live + > components, as they are a simpler abstraction, with a smaller surface + > area. The use case for live components only arises when there is a need + > for encapsulating both event handling and additional state. + ## Life-cycle ### Mount and update