PageSourceSearch

https://create-react-app.dev/assets/js/469e441c.5cd2b025.js

js create-react-app.dev collected 2026-09-24 07:30:18 UTC 4,428 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkcra_docs=self.webpackChunkcra_docs||[]).push([[6701],{876:function(e,t,n){n.d(t,{Zo:function(){return u},kt:function(){return b}});var r=n(2784);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var c=r.createContext({}),s=function(e){var t=r.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return r.createElement(c.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,c=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),d=s(n),b=a,f=d["".concat(c,".").concat(b)]||d[b]||p[b]||o;return n?r.createElement(f,i(i({ref:t},u),{},{components:n})):r.createElement(f,i({ref:t},u))}));function b(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=d;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var s=2;s<o;s++)i[s]=n[s];return r.createElement.apply(null,i)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},6607:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return l},contentTitle:function(){return c},metadata:function(){return s},toc:function(){return u},default:function(){return d}});var r=n(7896),a=n(1461),o=(n(2784),n(876)),i=["components"],l={id:"using-global-variables",title:"Using Global Variables"},c=void 0,s={unversionedId:"using-global-variables",id:"using-global-variables",title:"Using Global Variables",description:"When you include a script in the HTML file that defines global variables and try to use one of these variables in the code, the linter will complain because it cannot see the definition of the variable.",source:"@site/../docs/using-global-variables.md",sourceDirName:".",slug:"/using-global-variables",permalink:"/docs/using-global-variables",editUrl:"https://github.com/facebook/create-react-app/edit/main/docusaurus/website/../docs/using-global-variables.md",tags:[],version:"current",lastUpdatedBy:"Ian Sutherland",lastUpdatedAt:1571940855,formattedLastUpdatedAt:"10/24/2019",frontMatter:{id:"using-global-variables",title:"Using Global Variables"},sidebar:"docs",previous:{title:"Importing a Component",permalink:"/docs/importing-a-component"},next:{title:"Adding Bootstrap",permalink:"/docs/adding-bootstrap"}},u=[],p={toc:u};function d(e){var t=e.components,n=(0,a.Z)(e,i);return(0,o.kt)("wrapper",(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"When you include a script in the HTML file that defines global variables and try to use one of these variables in the code, the linter will complain because it cannot see the definition of the variable."),(0,o.kt)("p",null,"You can avoid this by reading the global variable explicitly from the ",(0,o.kt)("inlineCode",{parentName:"p"},"window")," object, for example:"),(0,o.kt)("pre",null,(0,o.kt)("code",{parentName:"pre",className:"language-js"},"const $ = window.$;\n")),(0,o.kt)("p",null,"This makes it clear you are using a global variable intentionally rather than because of a typo."),(0,o.kt)("p",null,"Alternatively, you can force the linter to ignore any line by adding ",(0,o.kt)("inlineCode",{parentName:"p"},"// eslint-disable-line")," after it."))}d.isMDXComponent=!0}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.