React? ?? ?? ?? ??
?? ??? ??? ?? ????? ??? ? ?? ??? React? ?????. ???? ?? ?? ??? ???? ??? ??? ??? ? ???? ????? ?? ?? ??? ?? ?????? ??? ????? ? ??? ???.
React? ?? ??? ???? ?? React.lazy ??? Suspense ????? ?????.
?? ??? ?? ??
- React.lazy: ?? ??? ???? ?????.
- Suspense: ????? ???? ?? ??(?: ?? ???)? ?????.
???
const LazyComponent = React.lazy(() => import('./path/to/Component')); function App() { return ( <React.Suspense fallback={<div>Loading...</div>}> <LazyComponent /> </React.Suspense> ); }
- React.lazy: ??? ?? ??? ???? ?????.
- ????: ?? ??? ?? ??? ???? ?? ??? ???? ?? ?? UI? ?????.
?? 1: ?? ?? ??
?? ?? ??
import React from "react"; import HeavyComponent from "./HeavyComponent"; function App() { return ( <div> <h1>App Component</h1> <HeavyComponent /> </div> ); } export default App;
? ???? HeavyComponent? ?? ???? ???? ?? ????? ?? ?? ??? ?????.
?? ?? ??
import React, { Suspense } from "react"; const HeavyComponent = React.lazy(() => import("./HeavyComponent")); function App() { return ( <div> <h1>App Component</h1> <Suspense fallback={<div>Loading Heavy Component...</div>}> <HeavyComponent /> </Suspense> </div> ); } export default App;
?? HeavyComponent? ???? ?? ?????. ?? ??? ???? ?? ?? UI(?: "??? ?? ?? ?? ?...")? ?????.
? 2: React Router? ??? ?? ??
?? ??? ?? ??? ???? ?? ?? ??? ????? ????? ????? ? ?? ?????.
import React, { Suspense } from "react"; import { BrowserRouter as Router, Routes, Route } from "react-router-dom"; const Home = React.lazy(() => import("./Home")); const About = React.lazy(() => import("./About")); const Contact = React.lazy(() => import("./Contact")); function App() { return ( <Router> <Suspense fallback={<div>Loading Page...</div>}> <Routes> <Route path="/" element={<Home />} /> <Route path="/about" element={<About />} /> <Route path="/contact" element={<Contact />} /> </Routes> </Suspense> </Router> ); } export default App;
- React.lazy: /about ? /contact? ?? ??? ?? ?? ??? ?? ?????.
- Suspense: ?? ??? ???? ?? ?? UI? ?????.
?? ??? ??
- ?? ??: ???? ?? ??? ??? ???? ?? ?? ??? ?????.
- ? ?? ??? ??: ?? ??? ???? ???? ??? ?? ??? ? ??? ???.
- ?? ?? ??: ??? ? ?? ???? ???? ??? ???? JavaScript ??? ??? ??????.
?? ?: ?? ???? ?? ??
?? ????? ?? ???? ??? ????? ??? ? ????.
const LazyComponent = React.lazy(() => import('./path/to/Component')); function App() { return ( <React.Suspense fallback={<div>Loading...</div>}> <LazyComponent /> </React.Suspense> ); }
?? ??? ?? ?? ??
?? ?? ?? ??? ??? ???? ??(?: ???? ??) React? ?? ??? ?? ?? ?? ?? ??? ???? ????. ErrorBoundary? ???? ??? ????? ??? ? ????.
import React from "react"; import HeavyComponent from "./HeavyComponent"; function App() { return ( <div> <h1>App Component</h1> <HeavyComponent /> </div> ); } export default App;
?? ?? ?? ??
- ??? ???? ?????: ???? ?? ???? ?? ??? ?? UI? ?????.
- ???? ???? ??: ??? ?? ?? ???? ????? ????? ?????.
- ?? ??? ??: ???? ?? ??? ?? Webpack ?? Vite? ?? ??? ?????.
??
React? ?? ??? ?????? ??? ???? ??? ??? ????? ??? ?????. React.lazy ? Suspense? ???? ?? ??? ???? ???? ?? ?? ??? ??? ???????? ??? ??? ????? ? ? ????.
? ??? ?? ?? ?? ??? React ? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

JavaScript? ??? ?? ????? ??? ?? ??? ??? ?? ?? ?? ????? ?? ???? ???? ?????. ??? ?? ???? ?? ??? ?? ??? ???? ???? ?? ?? ???? ???? ?????. ?? ??, ??? ? ?? ???? ??? (? : ??? null? ??) ?? ??? ????? ??????. ??? ??? ???? ??? ??? ????. closure?? ?? ??? ?? ??; ? ??? ??? ?? ?? ???? ?? ???? ????. V8 ??? ?? ???, ?? ??, ??/?? ???? ?? ??? ?? ??? ??? ????? ?? ??? ?? ??? ????. ?? ?? ???? ??? ??? ??? ??? ???? ????? ?? ?? ???? ?? ???????.

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

JavaScript ??? ??? ?? ?? ? ?? ???? ????. ?? ???? ???, ??, ??, ?, ???? ?? ? ??? ?????. ?? ????? ?? ?? ? ? ??? ????? ?? ??? ??? ????. ??, ?? ? ??? ?? ?? ??? ??? ??? ???? ??? ??? ???? ??? ?? ??? ????. ?? ? ????? ??? ???? ? ??? ? ??? TypeofNull? ??? ?????? ??? ? ????. ? ? ?? ??? ???? ?????? ????? ???? ??? ???? ? ??? ? ? ????.

?????, JavaScript ???! ?? ? JavaScript ??? ?? ?? ?????! ?? ?? ??? ??? ??? ? ????. Deno?? Oracle? ?? ??, ??? JavaScript ?? ??? ????, Google Chrome ???? ? ??? ??? ???? ?????. ?????! Deno Oracle? "JavaScript"??? ????? Oracle? ?? ??? ??? ??????. Node.js? Deno? ??? ? Ryan Dahl? ??? ?????? ???? ????? JavaScript? ??? ???? Oracle? ????? ???? ?????.

?? JavaScript ??? ??? ??? ?????? ?? ??? ?? ?? ??? ?? ???? ????. 1. ??? ???? ???? ?? ??? ?? ? ? ???? ??? ??? ?? ? ?? ????? ?????. 2. Angular? ?????? ??? ?? ???? ? ?? ?? ??? ??? ??? ???? ?????. 3. VUE? ???? ?? ??? ???? ?? ?? ??? ?????. ?? ?? ?? ??, ? ??, ???? ???? ? SSR? ???? ??? ??? ??? ???? ? ??? ?????. ???, ??? ??? ??? ????? ????. ??? ??? ??? ??? ?? ????.

iife (?? invokedfunctionexpression)? ?? ??? ???? ?? ????? ??? ???? ?? ??? ????? ?? ??? ? ?????. ??? ?? ?? ??? ???? ? ?? ??? ??? ?? (function () {/code/}) ();. ?? ???? ??? ?????. 1. ?? ??? ??? ?? ???? ?? ??? ??? ?????. 2. ?? ??? ??? ???? ?? ?? ??? ????. 3. ?? ?? ??? ????? ?? ???? ???????? ?? ? ??. ???? ?? ???? ?? ??? ES6 ??? ??? ??? ?? ? ??? ????? ??? ? ???? ???????.

??? JavaScript?? ??? ??? ?????? ?? ???????. ?? ??, ?? ?? ? ??? ??? ?? ????? ????? ?????. 1. ?? ??? ??? ????? ???? ??. ()? ?? ??? ??? ?????. ?. ()? ?? ??? ?? ??? ??? ?? ? ? ????. 2. ?? ??? .catch ()? ???? ?? ??? ??? ?? ??? ??????, ??? ???? ???? ????? ??? ? ????. 3. Promise.all ()? ?? ????? (?? ?? ?? ? ??????? ??), Promise.Race () (? ?? ??? ?? ?) ? Promise.AllSettled () (?? ??? ???? ??)

Cacheapi? ?????? ?? ???? ??? ???? ???, ?? ??? ??? ?? ???? ? ??? ?? ? ???? ??? ??????. 1. ???? ????, ??? ??, ?? ?? ?? ???? ???? ??? ? ????. 2. ??? ?? ?? ??? ?? ? ? ????. 3. ?? ?? ?? ?? ?? ??? ??? ?? ?????. 4. ??? ???? ?? ?? ???? ?? ?? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 5. ?? ???? ??, ??? ??? ? ??? ??, ?? ??? ? ?? ???? ???? ???? ? ?? ?????. 6.?? ??? ?? ?? ?? ??, ???? ?? ? HTTP ?? ????? ?????? ???????.
