Skip to content

Commit

Permalink
Remark on functional vs live components
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Aug 14, 2023
1 parent 52d5304 commit ba9065c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/phoenix_live_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba9065c

Please sign in to comment.