jaredpalmer / jaredpalmer/mutik

Fix example code

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
323
Forks
8
PR merge metrics
No merged PRs in 30d

Description

Hey, I didn't try the lib yet but reading the example it seems that you need to change ```state``` to ```prevState``` here:

```typescript
// Or you can update it like React.useState's update
function decrement() {
store.set(prevState => ({
...state,
count: state.count - 1
});
}
```

Contributor guide

Open the contributing guide

Research direction

Find the example containing the TypeScript decrement snippet and compare its update callback with React.useState's update form. Correct the example so it is valid and consistent with the stated usage, then verify that the displayed code can be read and used without the reported state-name error.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.