I just started using Surface and have been loving it! I wanted to move a piece of my code from the main .sface file to a Surface component, but when I did this the following line stopped working:
socket is available in the assigns map in a Surface View. However, it will not be available the Surface Component. You will have to make a prop and pass it from the view like so:
In the Surface component add the prop: prop(socket, :any, required: true). And in the view, pass the socket:
def render(assigns) do
~F"""
<Component socket={@socket} />
"""
end