From 4ec13be5e7afc588b91f883f9d69043e95baa5ce Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Thu, 22 Feb 2024 22:17:14 +0100 Subject: [PATCH] Update `morphdom` example with `idiomorph` in Handbook --- _source/handbook/02_drive.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_source/handbook/02_drive.md b/_source/handbook/02_drive.md index 5d3f840..d3eb145 100644 --- a/_source/handbook/02_drive.md +++ b/_source/handbook/02_drive.md @@ -79,14 +79,14 @@ Restoration visits cannot be canceled and do not fire `turbo:before-visit`. Turb Applications can customize the rendering process by adding a document-wide `turbo:before-render` event listener and overriding the `event.detail.render` property. -For example, you could merge the response document's `` element into the requesting document's `` element with [morphdom](https://github.com/patrick-steele-idem/morphdom): +For example, you could merge the response document's `` element into the requesting document's `` element with [idiomorph](https://github.com/bigskysoftware/idiomorph) or [morphdom](https://github.com/patrick-steele-idem/morphdom): ```javascript -import morphdom from "morphdom" +import { Idiomorph } from "idiomorph" addEventListener("turbo:before-render", (event) => { event.detail.render = (currentElement, newElement) => { - morphdom(currentElement, newElement) + Idiomorph.morph(currentElement, newElement) } }) ```