diff --git a/lib/phoenix_component.ex b/lib/phoenix_component.ex index 3e752c25ed..e3ad48a562 100644 --- a/lib/phoenix_component.ex +++ b/lib/phoenix_component.ex @@ -7,6 +7,7 @@ defmodule Phoenix.Component do [the `~H` sigil](`sigil_H/2`): defmodule MyComponent do + # In Phoenix apps, the line is typically: use MyAppWeb, :html use Phoenix.Component def greet(assigns) do @@ -135,6 +136,7 @@ defmodule Phoenix.Component do `` requires a `title`, but *does not* require a `name`. defmodule Components do + # In Phoenix apps, the line is typically: use MyAppWeb, :html use Phoenix.Component attr :title, :string, required: true diff --git a/lib/phoenix_live_component.ex b/lib/phoenix_live_component.ex index a22d678cdd..dbb2809e2a 100644 --- a/lib/phoenix_live_component.ex +++ b/lib/phoenix_live_component.ex @@ -13,8 +13,7 @@ defmodule Phoenix.LiveComponent do The smallest LiveComponent only needs to define a `c:render/1` function: defmodule HeroComponent do - # If you generated an app with mix phx.new --live, - # the line below would be: use MyAppWeb, :live_component + # In Phoenix apps, the line is typically: use MyAppWeb, :live_component use Phoenix.LiveComponent def render(assigns) do @@ -65,6 +64,7 @@ defmodule Phoenix.LiveComponent do a DOM ID, it is your responsibility to do so when rendering: defmodule UserComponent do + # In Phoenix apps, the line is typically: use MyAppWeb, :live_component use Phoenix.LiveComponent def render(assigns) do diff --git a/lib/phoenix_live_view.ex b/lib/phoenix_live_view.ex index d9a7027936..73f6b60fe8 100644 --- a/lib/phoenix_live_view.ex +++ b/lib/phoenix_live_view.ex @@ -72,7 +72,7 @@ defmodule Phoenix.LiveView do `c:render/1`: defmodule MyAppWeb.ThermostatLive do - # In Phoenix v1.6+ apps, the line is typically: use MyAppWeb, :live_view + # In Phoenix apps, the line is typically: use MyAppWeb, :live_view use Phoenix.LiveView def render(assigns) do @@ -139,6 +139,7 @@ defmodule Phoenix.LiveView do with a timer: defmodule DemoWeb.ThermostatLive do + # In Phoenix apps, the line is typically: use MyAppWeb, :live_view use Phoenix.LiveView ...