Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attribute to set key to livewire widget. #5522

Merged
merged 1 commit into from
May 20, 2024
Merged

Attribute to set key to livewire widget. #5522

merged 1 commit into from
May 20, 2024

Conversation

karandatwani92
Copy link
Contributor

WHY

I have a livewire component, and I need to set a key to the livewire component, but the widget gives no way to set one.

AFTER - What is happening after this PR?

Now I can, with the added key attribute.

Widget::make([
   'type'        => 'livewire',
   'content'   => 'livewire-line-chart',
   'parameters'      => ['lineChartModel' => $lineChartModel],
   'livewireAssets' => false,
   'wrapperClass' => 'col-md-12',
+  'key'=>$lineChartModel->reactiveKey(),
]);

Is it a breaking change?

NO

How can we test the before & after?

Just remove or pass the key.

@pxpm pxpm assigned karandatwani92 and unassigned pxpm May 17, 2024
@pxpm pxpm merged commit f2257fe into main May 20, 2024
9 checks passed
@pxpm pxpm deleted the livewire-widget-key branch May 20, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants