<% name = %{first_name: "Thomas", second_name: "Anderson"}
<hello assigns={name}>
Is there a way to directly supply a map of assigns like this? I know I can manipulate assigns inside my component, I’m hoping for a way to avoid that and just supply the right argument to the component.
You’re a star, thankyou. I had ignored that format for some reason, and just found the ~H code again after you posted that, now I understand more. Thanks.
This isn’t in the documentation for components anywhere that I can see. I’ll confirm that and PR something to the right place.
I can’t see why that warning (as it pertains to variable tracking) would apply to <hello {name}>… Are you saying that this format will prevent variable tracking from working?
We’ll do some more looking into what happens with the granular change tracking, as this is actually being used in a wider heex view something like this:
So while the component itself will not block granular tracking, it looks like using the component like this will break granular tracking. Though, if my understanding is correct, chaning [:owner, :first_name] will therefore cause the entire first component to re-render, but the second component won’t re-render.
Am I correct? Can you suggest a way that would allow me to change the owner’s first name in the names map, and keep the diff to only being the first name inside the first component?