??? ?? ??? ???? ? ??? ???? ??? ? ?? ??? ????????.
? ??? ???? ??? ? ?? ??? ?????? ??? ?? ??? ???? React?? useState
? useEffect
??? ?????. ? ??? ?????? ??? ???? ??? ????.
<code class="javascript">import { useState, useEffect } from 'react'; function useWindowSize() { // Initialize state with undefined width/height so server-side render works const [windowSize, setWindowSize] = useState({ width: undefined, height: undefined, }); useEffect(() => { // Handler to call on window resize function handleResize() { // Set window width/height to state setWindowSize({ width: window.innerWidth, height: window.innerHeight, }); } // Add event listener window.addEventListener("resize", handleResize); // Call handler right away so state gets updated with initial window size handleResize(); // Remove event listener on cleanup return () => window.removeEventListener("resize", handleResize); }, []); // Empty array ensures that effect is only run on mount return windowSize; } export default useWindowSize;</code>
? ??? ?? ?? useWindowSize
useState
hook? ???? ? ??? ??? ???? Window? Resize ???? useEffect
???? ???? ?????. ??? ?? ? ??? ?? ??? ??? ???? ???? ?? ???? ??? ? ????.
? ?? ??? ????? ?????? ?? ??? ?? ??? ????? ?????????
????? ? ?? ??? ???????? ??? ?? ??? ????? ?? ??? ?????.
- ??? ?? ?? ?? : ?? ? ???? ???? ? ?????? React??
useState
?useEffect
?? ????. - ?? ??? :
useState
????width
?height
??undefined
??? ??? ???????. ?? ??window
??? ??? ?? ? ??? ?? ??? ???? ?? ? ? ????. - ?? ?? ??? ?? : ??
window.innerWidth
?window.innerHeight
? ??? ?????? ??handleResize
??????. - ??? ??? ?? : Inside
useEffect
, ??? ????resize
????window
??? ??????. ? ???? ? ??? ?? ? ???handleResize
?????. - ?? ?? :
useEffect
??? ??handleResize
???? ?? ? ??? ??????. - ?? : ?? ??? ???? ?? ??? ??? ?? ??? ? ??? ???? ????
useEffect
?? ?? ??? ?????. - ?? ?? : ?????, ????? ??? ? ???
windowSize
? ???? ??? ? ??? ????? ?????? ???? ???? ??? ? ??????.
Window ??? ???? ?? ??? ????? ?????? ?? ??? ?? ??? ???? ?? ??? ??????
??? ?? ??? ???? ? ??? ???? ?? ??? ???? ? ? ?? ?? ??? ??????.
- ??? ??? :
useMemo
??useCallback
???? ? ?? ?? ?? ? ??? ???? ?? ??? ???????. ??? ???? ? ??? ?????. - ?? ?? ?? ??? : ?? ?? ?? ?? ??? ????? ????? ?? ?? ??? ???? ????? ?? ??????.
lodash.debounce
? ?? ??????? ??? ?? ? ? ????. - ??? ??? : ? ??? ???? ???? ?? ?????? ?? ??? ??????. ?? UI? ??? ?? ??? ???? ??? ??? ???? ? ????.
- ?? ? ??? ??? :
undefined
??? ??? ????? ????? ??window
????? ???? ??? ?? ? ???? ?? ????? ?????. - ?? : Memory Leaks? ???? ??
useEffect
?? ???? ?? ??? ???? ??????. - ??? ? : ?? ?? ??? ?????? ??? ??? ? ? ??? ??????. ?? ?? (? ?? ? ?? ??)? ??????.
- ??? : ??? ?? ??? ?? ???? ???? ??? ? ??? ?? ?? ???? ??? ? ??? ???? ???? ????? ??????.
? ?? ?? ??? ?? React ?? ??? ???? ??? ?? ?? ? ? ?????
??? useWindowSize
??? ?? React ?? ??? ???? ??? ????.
<code class="jsx">import React from 'react'; import useWindowSize from './useWindowSize'; // Assuming the hook is in a separate file function MyComponent() { const { width, height } = useWindowSize(); return ( <div> <h1>Current Window Size</h1> <p>Width: {width}px</p> <p>Height: {height}px</p> {width > 768 ? ( <p>This is a wide screen layout</p> ) : ( <p>This is a narrow screen layout</p> )} </div> ); } export default MyComponent;</code>
? ??? MyComponent
useWindowSize
??? ???? ?? ? ??? ????. ?? ?? ??? ??? ???? ? ??? ?? ?? ???? ???? ????? ? ?????. ?? ??? ?? ??? ?? ???? ? ??? ?? UI? ???? ?????? ??? ?????.
? ??? ??? ?? ??? ???? ? ??? ???? ??? ? ?? ??? ????????.? ?? ?????. ??? ??? 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)

??? ??

ariaattributesenhancewebaccessibilityforuserswithdisabilities withditionalsominticinformationstivetechnologies.theyareneededbecausemodernjavascript-heavycomponentsoftenlackthebuilt-in-inacessibilityfeaturesofnativehtmlelements ? Ariafill

React ??? ???? ???? ?? ????? ??? ??? ??? ????? ?? ? ??? ??? ?????. 1. eseref? ?? ?? ?? ??? ?? ????? ???? ??? ????? ???? ???? ?? ??? ??????. 2. ARIA ??? ???? ? ?? ??? ?? ? ?? ??? ?? ???? ??????. 3. ??? ????????? ??? ?? ??? ?? ?? ??? ?? ??? ???????. 4. ???? HTML ??? ???? ??? ?? ??? ???? ? ?? ??? ????. 5. REACT? DOM? ???? ARIA ??? ???? ???? ????? ??? ??? ??? ?????? ?? ????.

?? ??? ?? ?? ??? ? ???. ??? ??, ??? ?? ? ?? ??? HTTP ??? ??? ?? ?????. 1. CSS ? JavaScript ??? ???? ?? ??? ?? ?? ??? ??? ???? ?? ?? ??? ?????. 2. Picture Sprite ?? Inline Base64 ??? ???? ?? ?? ???? ??? ??? ?? ?? ????. 3. ???? ?? ??? ???? CDN?? ?????? ????? ????? ??? ??? ??? ??? ?? ??? ?? ??? ??????. 4.?? ?????? = "???"?? ????? ???? ??? ?? ??? ??? ????? ?? ??? ??? ??? ??? ??? ??? ?????????. ??? ??? ?? ??? ?? ??? ?????? ? ????? ??? ?? ??? ? ? ????.

CSS ??? ?? ??? ??, ?? ?? ? ??? ?? ??? ?? ?? ????? ??? ???? ?????? ?? CSS ?? ?? ?? ? ? ????. ???? ???? ?? ??? ??, ?? ?? ?? ?????, ??? ??, ??? ??? ?? ? ??? ?????. ?? ??? ?? : ?? ?? ?? ??? ?????. ?? ?? ?? ??? ????? ?? ??? ???? ? ??? ? ??????? ???????. ??? ??? ???? ?? ? ????? ?? ?? ??? ???? ????? ?? ??? ???? Cubic-Bezier??? ??? ?? ? ? ????. @Media? ?? ? ? ?? ??? ?? ???? ?? ??? ??? ???? ?? ???? (Prefers-

?? ? ???? DIV? ???? 1. Flexbox? ?????? : ?? ???? ?? ????? : Flex, ??? ? ?? ??? ????; 2. ??? ?? : ?? ???? ?? ????? : ???, ?? ?? ????; 3. ?? ???? ? ?? : ?? ??? ??? ???? ?? ? ??? 50%?, 50%? ?????. ?? : 0auto? ?? ??? ? ?? ? ? ????.

StrictMode? React?? ??? ???? ?????? ??? ?? ?? ?? ?????. ?? ??? ???? ??? ? ??, ?? ??? ?? ?????? ?? ?? ??? ?? ??? ??? ??? ??? ????? ?? ????. ?????, ???? ?? ???? ??? ????? ??? ???? ???? ???? ??? ??? ??? ??? ?? ?????. ?? ?? ??? ?? ????? ??? ???? ??? ???? ???? ???? ?? ??? ??? ?? ??? ??? ???? ?? ? ? ????. ??? ??? ?? useref ?? ?? ??? ?? ?? REF ??? ????? ?????. stri? ????? ?????

Shallowrenderingtestsacomponentinisolation,withoutchildren,whilefullrenderingincludesallchildcomponents.Shallowrenderingisgoodfortestingacomponent’sownlogicandmarkup,offeringfasterexecutionandisolationfromchildbehavior,butlacksfulllifecycleandDOMinte

?? ? ?? ???? ???? ?? ???? ??? ? ??? VueCli ?? Vite? ???? TypeScript ?? ????? ????. ?? ??? ??? ???? ?? ???? ?? ??? ???? ?? ? ?? ??? ?? ??? ???? ????? ?? ??? ???? ??? ??? ???? ?? ????. ?? ???? Ref ? Reactive? ??? ? ??? ?? ??? ?????? ?? ?? ?? ? ?? ???? ????? ?? ????.
