histoire-dev / histoire-dev/histoire

Pinia state is lost between controls and component

Open
#548 3 comments 0 reactions 0 assignees View on GitHub
to triage
Dominant language
TypeScript
Stars
3.6k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

I'm trying to setup a control that changes the value in a Pinia store which my component should then reflect. However, when the control changes a value in the Pinia store, it's not reflected in the Pinia state of the component in the story itself.

### Reproduction

https://stackblitz.com/edit/histoire-vue3-starter-xjnf5y

https://github.com/histoire-dev/histoire/assets/9141017/1726962c-5fd4-4819-b78e-e793f4f4e3bf

### System Info

```shell
System:
OS: macOS 13.4
CPU: (8) arm64 Apple M1 Pro
Memory: 94.70 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.0 - /usr/local/bin/node
Yarn: 1.22.19 - ~/Library/pnpm/yarn
npm: 9.5.1 - /usr/local/bin/npm
Browsers:
Edge: 109.0.1518.52
Firefox Developer Edition: 107.0
Safari: 16.5
npmPackages:
@histoire/plugin-vue: 0.16.1 => 0.16.1
@histoire/shared: 0.16.1 => 0.16.1
@vitejs/plugin-vue: 4.2.3 => 4.2.3
histoire: 0.16.1 => 0.16.1
vite: 4.3.7 => 4.3.7
```

### Used Package Manager

pnpm

### Validations

- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a [GitHub Discussion](https://github.com/histoire-dev/histoire/discussions).
- [X] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.