mrdotb / live_react

✨ React inside Phoenix LiveView with seamless end-to-end reactivity
https://live-react-examples.fly.dev/simple
MIT License
88 stars 8 forks source link

feat: Add inner_block slot support pass as HTML #20

Open ci opened 3 days ago

ci commented 3 days ago

👋 @mrdotb - not sure if you wanna go this route, but I found this useful in my project, I've added some basic slot interop with react where we can pass the inner_block as { children } to the component, though it happens as HTML so providers etc won't work with nested react components (pretty similar to how live_vue does it)

Contributor checklist

mrdotb commented 3 days ago

Thanks for the PR :+1: I just looked a bit I will review it deeper when I have more time this week end.

Also could you add an example in the demo project. Did you test with SSR ?

ci commented 3 days ago

thanks, and yep tested with SSR, and with both vite / nodejs. I'll take a look at adding an example too!