-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix #3671: observer
+ StrictMode
#3673
Conversation
🦋 Changeset detectedLatest commit: 36eeb2f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Changes in render counts in deprecated tests are caused by React 18.0.0 -> 18.2.0. They were failing with pevious (pre 4.*) impl as well. See #3601 (comment) |
Put up a draft that avoids making props / state observable, so that it plays better with Reacts internals. This diff shows a) alternative patterns and b) a way to detect the otherwise now broken usage of props / state inside reactions / computed. 94d78da |
props/state/context are no longer observable. TODO: Tests demonstrating workaround. Shouldn't we throw instead? if (componentClass[isMobXReactObserverSymbol]) {
const displayName = getDisplayName(componentClass)
console.warn(
`The provided component class (${displayName})
has already been declared as an observer component.`
)
} else {
componentClass[isMobXReactObserverSymbol] = true
} Extending |
Sounds good to me!
Good idea, nails down that semantics at least. What can I do to help further push this change :) ? |
Documenting the non-reactive props change would be a big help :) |
Added tests demonstrating observable props/state/context workaround. Applying Explicit check for extending What would be nice to have, but I personally don't plan to do at the moment (help welcome):
What should be done next:
|
See #3718 as I don't think I can push to origin urugator. Will continue on remaining items coming days. |
@urugator some items are still open, but how'd you feel about releasing the current state? Since I don't entirely trust the current state of releases / changelog, I'm tempted to trigger a release, and then verify is everything ended up well and roll forward if anything went south. |
go for it |
@urugator just noticed no mobx-react-lite release was triggered. Should this have emitted a major there as well? |
Ah no, I think it worked. |
No description provided.