Skip to content

docs: document the requiresObservable option of autorun and reaction - #4744

Merged
kubk merged 2 commits into
mobxjs:mainfrom
elyor-sh:docs/reaction-requires-observable-option
Oct 22, 2026
Merged

kubk merged 2 commits into
mobxjs:mainfrom
elyor-sh:docs/reaction-requires-observable-option

Conversation

@elyor-sh

@elyor-sh elyor-sh commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Reference #3770

autorun and reaction accept a requiresObservable option that overrides the global reactionRequiresObservable setting per reaction, but it wasn't mentioned anywhere in the docs (as noted in #3770 (comment)).

  • Adds a requiresObservable entry to the Options section of reactions.md, with a short example.
  • Links to it from the reactionRequiresObservable section in configuration.md.

I checked the behaviour described here against mobx 7.1.0: true warns even when the global flag is off, and false suppresses the warning when the global flag is on.

@changeset-bot

changeset-bot Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 8562bb7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kubk

kubk commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks! The docs change looks good. Yet it doesn't actually close #3770 ? the issue is about observer components.

@kubk

kubk commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Thank you. I've updated "Closes" -> "Reference" and shortened the description a bit.

@kubk
kubk merged commit 1bd1235 into mobxjs:main Oct 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants