Custom form field - Check if state has a value?
I'm creating a custom form field which extends the Radio field.
How can i check if state has a value in the view? The idea is to dynamically hide something if state has a value.
5 Replies
I think
$getState()
should workIs there a method to set state also?
Setting state from the view is a bit strange, but I think
$state(...)
should do itquick action to clear the state. Ill link it to a method in livewire component via wire:click
@Patrick Boivin
Any idea why this does't work?
Not sure why the above wasn't working so just ended up using $set
There's not enough context, I need to see more code. But from what I see the button is probably outside of the livewire component you're trying to call this method on.