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

This commit is contained in:
Yao Wang 2021-11-28 21:07:17 +08:00 committed by GitHub
parent 5c0e4fad11
commit 7522d25557
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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