I’m trying to use Petal Components with Phoenix 1.7. I followed the directions at https://petal.build/components#install_petal_components. After that, if I define a LiveView module like this:
defmodule IknowWeb.PetalTest do
use IknowWeb, :live_view
def render(assigns) do
~H"""
<.button label="Button" to="/" />
"""
end
end
I get the error:
(CompileError) function button/1 imported from both
PetalComponents.Button and IknowWeb.CoreComponents, call is ambiguous
I can resolve the ambiguity by rewriting my render function like this:
def render(assigns) do
~H"""
<PetalComponents.Button.button label="Button" to="/" />
"""
end
I’m sure there is a better, less verbose way of doing this.
Any suggestions?