import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static values = { url: String }
connect() {
if (this.urlValue) Turbo.visit(this.urlValue)
}
}
Sometimes you want to “redirect” from a turbo stream response (especially for Turbo Native flows). Returning a stream that updates a frame to include a turbo-visit shim keeps behavior consistent across clients.