Skip to content
This repository was archived by the owner on Apr 11, 2025. It is now read-only.

Commit 5b0e29c

Browse files
committed
🐛 fix: 修正索引问题
1 parent f688dcd commit 5b0e29c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

packages/journey-map/src/index.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import type { FC, CSSProperties, ReactNode } from 'react';
2+
import type { FC, CSSProperties } from 'react';
33
import cls from 'classnames';
44

55
import Stage from './Stages';
@@ -47,13 +47,13 @@ const JourneyMap: FC<JourneyMapProps> = ({
4747
}) => {
4848
const store = useJourneyMap({ data, onChange, title, config });
4949

50-
const sections: Record<SectionType, ReactNode> = {
51-
action: <Actions />,
52-
stage: <Stage />,
53-
emotion: <Chart />,
54-
thought: <Thoughts />,
55-
chance: <div />,
56-
painSpot: <div />,
50+
const sections: Record<SectionType, FC> = {
51+
action: Actions,
52+
stage: Stage,
53+
emotion: Chart,
54+
thought: Thoughts,
55+
chance: () => <div />,
56+
painSpot: () => <div />,
5757
};
5858

5959
const arrange = store.config?.arrange || [
@@ -73,7 +73,10 @@ const JourneyMap: FC<JourneyMapProps> = ({
7373
<div className="avx-journey-map-title">{store.title}</div>
7474
) : null}
7575
<div className="avx-journey-map-content">
76-
{arrange.map((a) => sections[a])}
76+
{arrange.map((a) => {
77+
const Section = sections[a];
78+
return <Section key={a} />;
79+
})}
7780
</div>
7881
</div>
7982
</JourneyMapStore.Provider>

0 commit comments

Comments
 (0)