Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support non-dev builds in development environment #32341

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

haesoo-y
Copy link

@haesoo-y haesoo-y commented Feb 8, 2025

Summary

This PR is similar to the previous one, focusing on supporting elements or modules that were built for non-development environments.

ReactSharedInternals.actQueue can be undefined instead of null, so the check has been modified to use a falsy check for better reliability.

It fixes issues that can occur when using production-built third-party libraries or in microfrontend environments where multiple environments run together. If this PR is merged, it is expected to naturally resolve this issue as well.

The code has been modified following the approach used to resolve similar issues in the past.

ex1. printWarning

issue :

resolve:

// consoleWithStackDev.rn.js
function printWarning(level, format, args) {
  if (enableRemoveConsolePatches) {
    return;
  }
  if (__DEV__) {
    if (ReactSharedInternals.getCurrentStack) { // << THIS CHECK

ex2. _store.validated

issue : #32061

resolve :

// ReactJSXElement.js
  if (__DEV__) {
    // The cloned element should inherit the original element's key validation.
    if (oldElement._store) {  // << THIS CHECK
      clonedElement._store.validated = oldElement._store.validated;
    }

How did you test this change?

yarn test

related: #32030

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: React 19 cannot run apps in both dev & production mode simultaneously
2 participants