<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="361832" data-post-id="361832">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jberling" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jberling/120/37260_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jberling
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/mhanberg" rel="nofollow">@mhanberg</a> is it possible to add a HEEx function component? I tried to call the component as a component, and I tried to use the <code>c</code> word, but couldn’t figure it out.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="361832" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/does-anyone-use-temple-instead-of-heex-in-their-live-view-projects/63171/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-361832" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="361832"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="361834" data-post-id="361834">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mhanberg" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mhanberg/120/17162_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mhanberg
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Expert LSP Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>How were you calling the component?</p>
<p>Components are called in the same way, if the function component is imported or local to the current module, it’s just <code>c &amp;the_component/1</code></p>
<p>You can also call remote components like <code>c &amp;RemoteModule.component/1</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="361834" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/does-anyone-use-temple-instead-of-heex-in-their-live-view-projects/63171/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-361834" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="361834"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="361874" data-post-id="361874">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jberling" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jberling/120/37260_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jberling
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I tried this for example:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def subview(assigns) do
    temple do
      p do
        "this is a subview"
      end
    end
  end

  def my_view(assigns) do
    temple do
      div do
        c &amp;subview/1
      end
    end
  end
</code></pre>
<p>I get the error</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">error: undefined function component/3 (expected ScribeWeb.Crafting.StartLive to define such a function or for it to be imported, but none are available)
    │
 44 │     temple do
    │     ^^^^^^^^^
    │
    └─ (scribe 0.1.0) lib/scribe_web/crafting/live/start.ex:44: ScribeWeb.Crafting.StartLive.my_view/1
</code></pre>
<p>Where ScribeWeb.Crafting.StartLive is the module I’ve added the code to.</p>
<p>If I change my_view to</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def my_view(assigns) do
    ~H"""
    &lt;div&gt;
      &lt;.subview /&gt;
    &lt;/div&gt;
    """
  end
</code></pre>
<p>it works fine.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="361874" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/does-anyone-use-temple-instead-of-heex-in-their-live-view-projects/63171/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-361874" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="361874"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="361876" data-post-id="361876">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="mhanberg" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mhanberg/120/17162_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  mhanberg
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Expert LSP Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Ahh, sorry I misunderstood.</p>
<p>Temple needs you to import a component implementation.</p>
<p>In the case of a non-live view project, you can easily provide your own as shown in the docs. <a href="https://hexdocs.pm/temple/Temple.Component.html" class="inline-onebox" rel="noopener nofollow ugc">Temple.Component — Temple v0.14.1</a></p>
<p>In the case of live view, the component implementation lives in Phoenix.LiveView.TagEngine.</p>
<p>So, you can simply import that module at the top of the file.</p>
<p>I’ll improve the docs and guides on this matter.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="361876" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/does-anyone-use-temple-instead-of-heex-in-their-live-view-projects/63171/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-361876" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="361876"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="361918" data-post-id="361918">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jberling" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jberling/120/37260_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jberling
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks! That worked perfectly.</p>
<p>I added it to my_web.ex, so now I can easily switch between Heex and temple without any extra ceremony in the live view modules themselves.</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">  def live_view do
    quote do
      use Phoenix.LiveView,
        layout: {ScribeWeb.Layouts, :empty}

      import Temple
      import Phoenix.LiveView.TagEngine

      unquote(html_helpers())
    end
  end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="361918" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/does-anyone-use-temple-instead-of-heex-in-their-live-view-projects/63171/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-361918" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="361918"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>