-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Pass context to components through mount #1488
Pass context to components through mount #1488
Conversation
@matthewmcgarvey This is awesome, and if we can extend I'm having trouble visualizing when I'd hit the scenario you describe here:
What would that look like in an app to render a component without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's funny, I had the same thought just the other day! Really, this is the big one. Anything else like current_user
or current_site
can still be as needed. This was really the only annoying one. I dig it!
On my phone so I can't link to the specific lines but at the bottom of this file where components can be provided also needs to pass in the context https://www.github.com/luckyframework/lucky/tree/master/src/lucky/renderable.cr |
Ah, right! |
@jwoertink @stephendolan You approved when it was a draft, is this good to merge now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. Looks good to me
Likewise! I don't see any downsides to getting this merged. |
Purpose
Related to #1152
Description
Instead of implementing
mount_defaults
the main code that we want passed down into components without being asked for is the context. This adds it to be passed in just like view is.