Skip to content

Conversation

@JohnathonKoster
Copy link
Contributor

When passing $attributes to child components that define props, multi-word/hyphenated attributes will become part of the nested component's prop data:

<!-- resources/dagger/views/wrapper.blade.php -->

<c-child :$attributes />
<!-- resources/dagger/views/child.blade.php -->
@props(['one', 'twoWords'])

{{ $one }} {{ $twoWords }}
<!-- resources/views/template.blade.php -->

<c-wrapper one="one" two-words="two" />

@JohnathonKoster JohnathonKoster merged commit 1e04ee6 into main Jan 25, 2025
12 checks passed
@JohnathonKoster JohnathonKoster deleted the attributes-are-merged-into-data branch January 25, 2025 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants