Sfoglia il codice sorgente

fix(core advance example): display right state (#406)

main
Yao Wang 3 anni fa
parent
commit
7522d25557
Nessun account collegato all'indirizzo email del committer

+ 4
- 1
examples/core-example-advanced/src/components/Toolbar.tsx Vedi File

@@ -51,7 +51,10 @@ export function Toolbar({ activeStates, lastEvent }: ToolbarProps) {
51 51
           <button onClick={onReset}>Reset</button>
52 52
           {activeStates
53 53
             .slice(1)
54
-            .map((name) => name.split('#state_1.root')[1])
54
+            .map((name) => {
55
+              const state = name.split('.')
56
+              return state[state.length - 1]
57
+            })
55 58
             .join(' - ')}
56 59
         </div>
57 60
         <div>{lastEvent}</div>

Loading…
Annulla
Salva