Skip to content

Commit db13fae

Browse files
committed
fix(routing): add data attribute to links
This way you can distinguish xstate-tree links from plain a tags
1 parent 88a1023 commit db13fae

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/routing/Link.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ function LinkInner<TRoute extends AnyRoute>(
9696
onMouseDown={onMouseDown ?? _onMouseDown}
9797
onMouseEnter={onMouseEnter ?? _onMouseEnter}
9898
onMouseLeave={onMouseLeave ?? _onMouseLeave}
99+
data-xstate-tree
99100
onClick={(e) => {
100101
if (props.onClick?.(e) === false) {
101102
return;

src/test-app/tests/__snapshots__/itWorks.integration.tsx.snap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ exports[`Test app renders the initial app 1`] = `
1414
</p>
1515
<a
1616
data-testid="swap-to-other-machine"
17+
data-xstate-tree="true"
1718
href="/settings/"
1819
>
1920
Swap to settings

0 commit comments

Comments
 (0)