I have a few modals when opened they dynamically load their contents via AJAX and set their own innerHTML from the response. These responses have livewire components in them. When they’re added to page via innertHTML, livewire components are not initialized. I’ve checked how TurboLinks integration is doing it, and tried calling window.livewire.restart()
after updating the innerHTML, but this time I get the following JS error on the console:
TypeError: Cannot read property 'data' of null
Do you have any ideas on how to initialize livewire components that are loaded via ajax and added to the page via innertHTML?