From db13fae54d5274f15b20926686565ab8d37a8225 Mon Sep 17 00:00:00 2001 From: Taylor Lodge Date: Tue, 19 Sep 2023 09:30:10 +1200 Subject: [PATCH] fix(routing): add data attribute to links This way you can distinguish xstate-tree links from plain a tags --- src/routing/Link.tsx | 1 + src/test-app/tests/__snapshots__/itWorks.integration.tsx.snap | 1 + 2 files changed, 2 insertions(+) diff --git a/src/routing/Link.tsx b/src/routing/Link.tsx index 82f47e8..9a6458f 100644 --- a/src/routing/Link.tsx +++ b/src/routing/Link.tsx @@ -96,6 +96,7 @@ function LinkInner( onMouseDown={onMouseDown ?? _onMouseDown} onMouseEnter={onMouseEnter ?? _onMouseEnter} onMouseLeave={onMouseLeave ?? _onMouseLeave} + data-xstate-tree onClick={(e) => { if (props.onClick?.(e) === false) { return; diff --git a/src/test-app/tests/__snapshots__/itWorks.integration.tsx.snap b/src/test-app/tests/__snapshots__/itWorks.integration.tsx.snap index b7b78f4..36df0b5 100644 --- a/src/test-app/tests/__snapshots__/itWorks.integration.tsx.snap +++ b/src/test-app/tests/__snapshots__/itWorks.integration.tsx.snap @@ -14,6 +14,7 @@ exports[`Test app renders the initial app 1`] = `

Swap to settings