immerjs / immerjs/immer

How do I flag some properties in initial state for useImmerReducer as private or with any other modifier

Open
#1,146 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
JavaScript
Stars
29k
Forks
881
PR merge metrics
No merged PRs in 30d

Description

🙋‍♂ Question

How do I flag with modifier some of my properties in initial state for useImmerReducer without getting error. If I delete flag everything works, but I don't want to see some of properties appear in autocomplete while trying to access state from useImmerReducer:

Here is my model for useImmerReducer initial state:
image

Here is my reducer:
image

Here is error I am getting:
image

Environment

Vite React

  • Immer version:
    "immer": "^10.1.1",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "use-immer": "^0.10.0",

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the useImmerReducer API and the reported TypeScript error, using the model and reducer shown in the issue to reproduce the behavior. Check whether private or other property modifiers are supported in this usage, then document the supported approach or limitation with a focused example and verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.