fix: clear fieldState errors when resolver uses dot-notation string keys#4630
Open
tomeelog wants to merge 1 commit intomobxjs:mainfrom
Open
fix: clear fieldState errors when resolver uses dot-notation string keys#4630tomeelog wants to merge 1 commit intomobxjs:mainfrom
tomeelog wants to merge 1 commit intomobxjs:mainfrom
Conversation
…with observer When a component is wrapped with `observer` using an arrow function (the most common pattern in examples), `eslint-plugin-react-hooks` rules such as `rules-of-hooks` and `exhaustive-deps` silently stop working because the plugin does not recognise the wrapped result as a React component. Add a new collapsible tip section that: - explains why the problem occurs - shows that using a named function inside `observer` fixes it - cross-references the displayName tip since both share the same solution - mentions the `componentWrapperFunctions` eslint-plugin-react option as a partial workaround (and clarifies its limitations) Related: mobxjs#4594
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a documentation tip to the React integration guide explaining that
eslint-plugin-react-hooksrules (e.g.rules-of-hooks,exhaustive-deps) do not work correctly whenobserver()wraps an arrow function expression, because the linter cannot identify it as a React component.The tip shows the workaround: pass a named function to
observer()instead.Addresses #4594
Code change checklist
/docs. For new functionality, at leastAPI.mdshould be updatedyarn mobx test:performance)