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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks.</p>
<p>I’m curious how this new api works regarding the first server side render.  If I understand correctly, rendering the page used to happen immediately after mount/2.  Does it now happen after handle_params/3 in order to avoid flash of a blank page on first paint?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="151572" 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/how-do-i-get-path-parameters-in-liveview/25994/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-151572" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="151572"
                     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="151578" data-post-id="151578">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="benwilson512" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/benwilson512/120/1457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  benwilson512
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Author of Craft GraphQL APIs in Elixir with Absinthe</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="homanchou" data-post="12" data-topic="25994">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/homanchou/48/1930_2.png" class="avatar"> homanchou:</div>
<blockquote>
<p>If I understand correctly, rendering the page used to happen immediately after mount/2.</p>
</blockquote>
</aside>
<p>This is not the case. handle_params gets called once between the first call of mount and the first call of render.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="151578" data-batch-url="/posts/batch_likers">
                        2
                      </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/how-do-i-get-path-parameters-in-liveview/25994/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-151578" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="151578"
                     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="160223" data-post-id="160223">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hello All,<br>
I found this thread while trying to get params for a “router” liveview.<br>
This has changed very recently (with version 0.6.0) so I put this as a reminder for future readers.</p>
<p>Now it is possible to get params (url ids + querystrings) directly from mount/3 which now accepts params as a first argument, ex :</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">def mount(%{"id" =&gt; id, "token" =&gt; token} = params, session, socket) do
....
</code></pre>
<p>I think this is the correct way of handling it as of today <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p>
<p>Cheers,<br>
Sébastien.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="160223" data-batch-url="/posts/batch_likers">
                        10
                      </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/how-do-i-get-path-parameters-in-liveview/25994/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-160223" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="160223"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></div>
  </section>
</div>
    <div class="postbit" id="163055" data-post-id="163055">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Useful clarification recently added by Jose when deciding whether to use mount or handle_params</p>
<blockquote>
<p>Note the parameters given to <code>c:handle_params/3</code> are the same as the ones given<br>
to <code>c:mount/3</code>. So how do you decide which callback to use to load data?<br>
Generally speaking, data should always be loaded on <code>c:mount/3</code>, since <code>c:mount/3</code><br>
is invoked once per LiveView life-cycle. Only the params you expect to be changed<br>
via <code>live_patch/2</code> or <code>push_patch/2</code> must be loaded on <code>c:handle_params/3</code>.</p>
</blockquote>
<p><a href="https://github.com/phoenixframework/phoenix_live_view/commit/34424f37c3be388414d180536f30b208d06602bd" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/phoenixframework/phoenix_live_view/commit/34424f37c3be388414d180536f30b208d06602bd</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="163055" data-batch-url="/posts/batch_likers">
                        5
                      </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/how-do-i-get-path-parameters-in-liveview/25994/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-163055" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="163055"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-most-liked cat-most-liked" title="One of the top 3 liked posts in this thread!"></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>