maxs15 / maxs15/react-native-modalbox

ModalBox should not mutate state directly

Open
#174 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.9k
Forks
496
PR merge metrics
No merged PRs in 30d

Description

ModalBox directly mutates state in some places which causes corner case timing bugs. There are situations where the modal should remain closed but suddenly opens by itself. This tends to happen in more complex scenarios where state is changing numerous times in various orders and frequencies.

[React docs](https://facebook.github.io/react/docs/react-component.html#instance-properties) say
`Never mutate this.state directly, as calling setState() afterwards may replace the mutation you made. Treat this.state as if it were immutable.
`

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

Locate the ModalBox component and inspect the places where its state is mutated directly, using the React guidance linked in the issue as the starting point. Confirm that state changes no longer cause the modal to open unexpectedly during complex sequences, and check the relevant existing behavior before considering the issue done.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.