Skip to content

Commit

Permalink
Merge pull request #9 from vikiboss/docs/add-faq
Browse files Browse the repository at this point in the history
docs: add FAQ about readonly hack
  • Loading branch information
ityuany authored Sep 15, 2023
2 parents 835fa1a + 432f443 commit d081355
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,24 @@ export default function Foo() {
}
```

## FAQ

### TS type error, `readonly` type can not be assigned to mutable type

This error commonly occurs when using [shineout](https://github.com/sheinsight/shineout), [antd](https://github.com/ant-design/ant-design) or other UI component libraries.

To resolve this issue, add following code to your entry file, and you can head to [PR#8](https://github.com/sheinsight/reactive/pull/8) for more details.

```ts
// add this line to your entry file, like `index.tsx`, `global.d.ts` or ect.
import "@shined/reactive/hack-remove-readonly";
```

## Examples

- [base-example](https://stackblitz.com/edit/vitejs-vite-zli31f?file=src%2Fmain.tsx)
- [multi-store-example](https://stackblitz.com/edit/vitejs-vite-n5azuk?file=src%2Fmain.tsx)

## License

- [MIT](LICENSE)
- [MIT](./LICENSE)
3 changes: 2 additions & 1 deletion packages/reactive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"test:cov": "vitest run --coverage"
},
"files": [
"dist"
"./dist",
"./hack-remove-readonly.d.ts"
],
"exports": {
".": {
Expand Down

0 comments on commit d081355

Please sign in to comment.