Getting Started

Hello React

Render a component from a controller, with no socket

  • dead view
  • SSR

Key concepts

react/1 works in any Phoenix template, not only inside a LiveView. This page has no socket: the component is server-rendered on the first request and hydrated in the browser, and there is no websocket behind it.

Hello world!

This example needs no LiveView. Open it standalone → to see it served with no socket.

How it works

The component is rendered by a plain function component from a controller action. Use this when you want React for its own sake — a widget, a chart, a third-party library — without any server-driven state.