oliverbusk's avatar

React with Livewire

Hi there.

I was wondering if I can use Laravel Livewire together with React? I have a few React components and libraries I want to use, but at the same time I want the simplicity for the rest of my website with Livewire.

Planning on using Laravel 10 with Jetstream.

0 likes
4 replies
webrobert's avatar

I haven't tried using them on the same page. But certainly you could have different layouts that work independently.

azimidev's avatar

Yes, it is possible to use Laravel Livewire together with React in the same application. You can use React components inside Livewire components, and vice versa but why do you want to do that? Jetstream doesn't have official React components especially when it comes to Inertia but I have used the third-party one with react and typescript for my work. And it works!

However i wouldn't do that as its a very bad practise.

eduardocruz's avatar

@azimidev I'm not sure if this is a new feature, but I do remember reading that Livewire is not compatible with things like Vue and React, because of how they handle the DOM differently. I might be wrong. But on the links you sent, they talk about jetstream and react. And not React and Livewire.

Sinnbeck's avatar

Maybe make sure that you have pages with react and other pages with livewire. Having both on the same page might be more a hazzle than it's worth

Please or to participate in this conversation.