Skip to content

Conversation

calebporzio
Copy link
Contributor

These are docs for the following PR: laravel/framework#39100

@calebporzio
Copy link
Contributor Author

I struggled with the right code example for this. I landed on the simples example that wasn't overly contrived. The only tradeoff being that in a production app using purgeCSS, because we are dynamically generating the text- and bg- classes, they wouldn't get picked up.

I think the tradeoff here is worth it for demonstrating the technique.


<!-- /resources/views/components/menu/item.blade.php -->

@aware(['color'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to set the default in the parent and the child because @props doesn't get evaluated before the child has finished rendering. This may be something we want to consider before merging…

Suggested change
@aware(['color'])
@aware(['color' => 'gray'])

@taylorotwell
Copy link
Member

Marking as draft until release day.

@taylorotwell taylorotwell marked this pull request as draft October 6, 2021 15:44
@taylorotwell taylorotwell marked this pull request as ready for review October 12, 2021 13:52
@taylorotwell taylorotwell merged commit 0105c63 into laravel:8.x Oct 12, 2021
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.

3 participants