MRdotB
Live_react - React inside Phoenix LiveView
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live_vue and live_svelte. So, I created the equivalent in React, live_react:
Here is a small demo on Fly: demo.
I have not yet implemented SSR, slots, sigil, and the macro to generate components.
Most Liked
MRdotB
live_react has been picking up interest, as seen in projects like PhoenixAnalytics. Inspired by the Server-Side Rendering (SSR) features in live_svelte and live_vue, I’ve implemented it for live_react.
I released a 0.2.0-beta and will release 0.2.0 when I’m confident the SSR feature is production ready.
MRdotB
I released the stable v1.0.0
I have been using live_react in production for different project.
Breaking Changes:
- vitejs: switch from Mix Esbuild to Vite.js
Features:
- add tests based on the one from live_vue
- add SSR support
- support inner_block slot
- context provider for live_react
- add typescript support
johnknott
Great work! I do wonder if there is some kind of shared abstraction these libraries could build on - if there was something like live_vite or live_frontend, or something like that, then have adaptors for each FE framework.
MRdotB
The LOC of each library is quite short but specific to Vite, Svelte, React.
| Builder | JS Prod | |
|---|---|---|
| live_svelte | Custom esbuild | none |
| live_vue | vite | vue |
| live_react | hex esbuild | react, react-dom |
Have a look at the hooks.js of each
orion
Great work! Thank you for live_react!
I’m not sure if it’s what @johnknott had in mind but have you looked at Komodo?







