- Replace
Phoenixreactwith your project's name - Replace
phoenixreactwith your project's name lowercased. - Rename
phoenixreact_...directories with your project's name lowercased.
mix install
mix lintto lint via eslint with prettier rules.mix tsfor type checking.
To server render a component, pass in a prop of ssr set to true.
def home(conn, _params) do
conn
...
|> assign_prop(:ssr, true)
|> render_inertia("some-component", ssr: true)
endAssigns server side page_title and passes a prop to set the same value on the client.
def home(conn, _params) do
conn
...
|> PhoenixreactWeb.PageTitle.assign("Home Page - My App")
...
endTo start your Phoenix server:
- Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
Now you can visit localhost:4000 from your browser.
Ready to run in production? Please check our deployment guides.
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix