Skip to content

A repro of an issue with Phoenix LiveView hooks on deadview pages

Notifications You must be signed in to change notification settings

ChristianAlexander/deadview_live_render_hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeadviewLiveRenderHooks

What is this?

This is an example repository that demonstrates an issue where deadview phx-hooks don’t run when a liveview is live_rendered on the page.

How to repro

This repository uses two hooks, HelloDeadView and HelloLiveView. They each write a message to the browser console.

  1. To repro the issue where a deadview hook is not executed, run mix phx.server and open a browser to http://localhost:4000. You’ll only see "Hello live view" in the browser console.
  2. To observe that the deadview hook does run when live_render is not called, remove the live_render in index.html.heex. The browser console should now show "Hello dead view".

Expectation

The LiveView 0.18 changelog included the enhancement "Add dead view support for hooks". I’d expect that this support would still work on a hybrid page that embeds a rendered LiveView but is otherwise dead.

About

A repro of an issue with Phoenix LiveView hooks on deadview pages

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published