3 ms·
When using LiveView I always use: import Phoenix.Component, only: [assign: 2, assign: 3] https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#assign/
by sodapopcan 3y ago
When using LiveView I always use:
import Phoenix.Component, only: [assign: 2, assign: 3]
https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#assign/2 https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#...
Importing from Socket should work, but you're right, the code in the post wouldn't work. They use to be in LiveView but got moved to Component.
- gnutrino 3y agoI'm still on 17.X, so that probably explains the discrepancy here. I think I tried doing a major version bump a while back and things didn't compile so I put it on the backlog and forgot about it. It may be time to revisit before I get too far behind.