You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
// This is local to the current filevarABC=function(){};// This is globally available in the APPXYZ=function(){};
But in packages:
// This is local to the current filevarABC=function(){};// This is globally available in the PACKAGEXYZ=function(){};
In order to make a package global variables available in apps that include the package, you take one of these XYZ variables and export it in package.js.
So now to answer your question:
When you say:
XYZ=function(){};// (i.e. without var)
It assigns to this, which normally happens to be window in the browser. But in a package, it is assigned to something else (for package-wide variables). Assigning React to window would be "bad" because if you didn't export it in package.js it would be visible by apps anyway.
wondering what this does 🍻
The text was updated successfully, but these errors were encountered: