You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the context in a template defined inside a Surface.View, both (old) <Context get={...}> and (new) prop name, :type, from_context: ... in a used component yields nil.
How to reproduce it
Use surface initialized with --layouts
Use context in live.sface or a component used by live.sface
Describe the bug
When using the context in a template defined inside a
Surface.View
, both (old)<Context get={...}>
and (new)prop name, :type, from_context: ...
in a used component yieldsnil
.How to reproduce it
--layouts
live.sface
or a component used bylive.sface
nil
The behavior you expected
The value is read correctly.
Your Environment
Surface: v0.8.1
LiveView: v0.17.11
Elixir: v1.14.0
Culprit
I tracked down the issue to the following line:
surface/lib/surface/compiler/eex_engine.ex
Lines 1095 to 1100 in b9675f9
Since this looks like the context is intentionally set to an empty map, I decided not to attempt a PR for now.
Workaround
I built the component inclusion manually, for now, to work around the constraint / issue:
https://github.com/jshmrtn/hygeia/blob/c1debcb8c2652042ee1bf61b566ad2cb3e965ac7/lib/hygeia_web/templates/layout/live.sface#L2-L16
The text was updated successfully, but these errors were encountered: