You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since LiveView is now public, probably the developers will try to use both libraries in the same app, but at this time it is not possible because Drab.Client.generate_drab_js/3 rises when it tries to get the controller module for a LV page, as :phoenix_controller is not present in the conn of a LiveView page.
Checking for the presence of :live_view_module in the conn parameters reveals if the page is suited or not for generating the drab js, for example:
This way both libraries can cohabit at the same time in the same app, using Drab only for pages based on Controllers/.eex templates (but not for LiveView pages because its js code will not be injected).
Edit:
The PR #192 solve this problem with a more general solution than the one initially proposed above
The text was updated successfully, but these errors were encountered:
Since LiveView is now public, probably the developers will try to use both libraries in the same app, but at this time it is not possible because
Drab.Client.generate_drab_js/3
rises when it tries to get the controller module for aLV
page, as:phoenix_controller
is not present in theconn
of a LiveView page.Checking for the presence of
:live_view_module
in theconn
parameters reveals if the page is suited or not for generating the drab js, for example:This way both libraries can cohabit at the same time in the same app, using Drab only for pages based on Controllers/.eex templates (but not for LiveView pages because its js code will not be injected).
Edit:
The PR #192 solve this problem with a more general solution than the one initially proposed above
The text was updated successfully, but these errors were encountered: