Skip to content

Questions around custom components #53

Description

@joshk

I'd like to use some components I've created using the tag syntax...

eg. <MyComponent arg={arg_1} />

But I'm finding the docs a bit confusing on how to make this happen.

For example:

defmodule MyApp.ReadingTile do
use Mob.Component
import Mob.Sigil, only: [sigil_MOB: 2]
def render(%{label: label, value: value, unit: unit, status: status, target: target}) do
~MOB"""
"""
end
end

along with

Mob.Composite.register(
:reading_tile,
{MyApp.ReadingTile, :render}
)

doesn't work. I also get the following warning during mix compile

warning: ~MOB: <ReadingTile> is not in the Mob tag whitelist — pass-through as :reading_tile

Any and all help would be great.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions