I have a stimulus controller and a turbo frame. Based on the documentation, I should be able to reload the frame since it is part of the FrameElement API.
Every on change event has the following error:
<code>frame.reload is not a function
</code>
<code>frame.reload is not a function
</code>
frame.reload is not a function
For some reason my querySelector gets an object, but it is not a FrameElement. Any help?
Template:
<code> <%=turbo_frame_tag "frame_id", src: my_path do%>
<%=render '....'%>
<% end %>
</code>
<code> <%=turbo_frame_tag "frame_id", src: my_path do%>
<%=render '....'%>
<% end %>
</code>
<%=turbo_frame_tag "frame_id", src: my_path do%>
<%=render '....'%>
<% end %>
Stimulus Controller:
<code> const frame = document.querySelector('turbo-frame#frame_id');
frame.reload();
</code>
<code> const frame = document.querySelector('turbo-frame#frame_id');
frame.reload();
</code>
const frame = document.querySelector('turbo-frame#frame_id');
frame.reload();
It turns out I didn’t actually import turbo. Oops.
<code>import "@hotwired/turbo-rails"
</code>
<code>import "@hotwired/turbo-rails"
</code>
import "@hotwired/turbo-rails"