Hi, I dont know if you found the answer but I was having the same issue as you. I found out that you can get the component id by using @this->__id in the blade component. Note the two underscores in front of id.
Oct 24, 2023
2
Level 2
How to get current component ID?
I'm probably missing something, but how do I get the Livewire's component ID inside of it, like, printing on the Blade template or on the component's x-init?
I mean, let's say I want to console.log() this unique component ID on it's x-init, how would I do that?
I tried dozens of variations based on what the Livewire 3 docs say, also the v2 docs and a bunch of other people's questions without success.
Please or to participate in this conversation.