Conversation
## Summary This PR adds missing initializers path to side effects (because some global variables are written in this file). It also fixes paths to remaining files (as there is no longer `reanimated2` directory).
## Summary
The problem was caused by our `useDerivedValue` hook which set ref to
`null` in the `useEffect` cleanup method.
```tsx
useEffect(() => {
return () => {
initRef.current = null;
};
}, []);
```
The warning was shown during hot reload, because react calls cleanup
functions in hooks, thus the `initRef` was reset in the
`useDerivedValue` hook, which resulted in execution of this code that
should run only when the component mounts for the first time:
```tsx
if (initRef.current === null) {
initRef.current = makeMutable(initialUpdaterRun(updater));
}
```
Because of that, `initialUpdaterRun` executed the `updater` callback on
the JS thread during hot reload, while the component was rendered, which
resulted in reading shared value's `.value` property during the render
phase.
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> ## Summary The API for sharedValue has changed from using .value to get() and set() methods. As a result, the mock that previously returned an object with a single value property no longer works in the tests. ## Test plan This is a PR for the mocks, so it's not necessary for it. --------- Co-authored-by: Tomasz Żelawski <tomasz.zelawski@swmansion.com>
<!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> Fixes #6665 Applying the change I made to `react-native-builder-bob`: - callstack/react-native-builder-bob#695 It restores `classic` runtime for the `@babel/react-native` preset used for generating ESModule code. The behavior was changed when we bumped builder-bob: - #6485 I ran the `diff` for the version of `lib` without `jsxRuntime: classic` and with it - the differences are only in regards to `_jsx` usage. You can read more here: - #6665
bartlomiejbloniarz
approved these changes
Nov 25, 2024
piaskowyk
approved these changes
Nov 26, 2024
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.
Summary
Cherry-picking:
classicruntime for @babel/preset-react #6760