React.js?? ?? ?? ??, ?? ?? ??? ?? ? ?? ??? ??? ? ?? ?? ?? ??? ????. ????? ?? ??? ??? ?? ???? ??????.
1. ???? ???? ??(??? ????)
React ??? ?? ???? ?? ?? ?? ??? ?? ??? ??? ???? ?? ???? ? ?? ?? ?? ?? ???? ????.
??? ??(???? ???)
-
???()
- ????? ????? ?? ?????.
- ?? ??? ?? ??? ??? ???? ?????.
-
static getDerivedStateFromProps(props, state)
- ?? ???? ?? ???? ?? ??? ?? ?????.
- props? ???? ??? ????? ? ????.
-
???()
- ??? ?????? ???? ??? ??????.
- DOM?? ???? React ??? ???? ???.
-
comComponentDidMount()
- ????? ???? ? ?? ?????.
- ??? ????, ?? ?? ?? API ??? ????? ?????.
???? ??(props ?? ?? ???? ?? ?? ???)
-
static getDerivedStateFromProps(props, state)
- (???? ??? ???) props? ???? ??? ?????? ? ?????.
-
shouldComponentUpdate(nextProps, nextState)
- ????? ???? ?????.
- ???? ???? ???? ??? ????? ? ??? ? ????.
-
???()
- (???? ? ?? ???)
-
getSnapshotBeforeUpdate(prevProps, prevState)
- ?? DOM? ?? ??? ?? DOM? ???? ??? ?????.
- ???? ? ??(?: ??? ??)? ???? ? ?????.
-
comComponentDidUpdate(prevProps, prevState, snapshot)
- ???? ? ?? ?????.
- ????? ????? ? ??? ???? ? ?????(?: prop ??? ?? API ?? ??).
??? ?? ??(?? ?? ?? ? ??)
-
????WillUnmount()
- ????? ??? ???? ???? ??? ?????.
- ??, ??? ?? ??? ???? ???? ? ?????.
?? ??
-
comComponentDidCatch(??, ??)
- ??? ?, ?? ?? ??? ?? ?? ?? ?? ???? ??? ?? ?? ?????.
- ?? ?? ? ?? UI ??? ?????.
2. React Hooks(?? ????)
??? ???? ???? ??? ?? ? ?? React ??? ??? ? ?? ??? React 16.8? ??? ?? ?????.
?? ??
-
useState(?? ??)
- ??? ?? ??? ??? ??? ? ????.
- ?? ??? ?? ?????? ??? ?????.
const [count, setCount] = useState(0);
-
useEffect(??, ???)
- commentorDidMount, componentDidUpdate ? componentWillUnmount? ??? ?? ?????.
- ??? ????, ?? ?? DOM ?? ??? ?? ???? ?????.
useEffect(() => { // Effect logic here return () => { // Cleanup logic here (like componentWillUnmount) }; }, [dependencies]);
-
useContext(????)
- Consumer ?? ??? ???? ??? React ????? ??? ? ????.
const value = useContext(MyContext);
?? ??
-
useReducer(reducer,initialState)
- ?? ??? ?? ??? ???? ?? useState? ?????.
const [state, dispatch] = useReducer(reducer, initialState);
-
useCallback(??, ???)
- ?? ??? ???? ?? ?? ??? ????? ? ??? ?? ??? ??? ??? ?????.
const memoizedCallback = useCallback(() => { doSomething(); }, [dependencies]);
-
useMemo(??, ???)
- ??? ?? ?? ??? ????? ? ???? ??? ?? ?????.
const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);
-
useRef(???)
- ??? ?? ???? ?? ??? ?? ??? ?????.
- DOM ??? ?????? ?? ??? ?? ???? ? ?????.
const inputRef = useRef();
-
useImperativeHandle(ref, createHandle, ???)
- forwardRef? ?? ref? ??? ? ???? ???? ?? ??? ?????.
useImperativeHandle(ref, () => ({ focus: () => inputRef.current.focus() }));
-
useLayoutEffect(??, ???)
- useEffect? ????? ?? DOM ?? ?? ????? ?????.
- DOM?? ????? ?? ????? ?? ????? ? ?????.
-
useDebugValue(?)
- React DevTools?? ??? ?? ??? ?? ??? ???? ? ??? ? ????.
const [count, setCount] = useState(0);
3. ??? ?? ??
React? ?? DOM ??? ??? ????? ? ?? ???? ?? ??? ?? ??? ?????.
- ??
- ?? ?
- ?? ?
- ??
- ?? ??
- KeyPress
?:
useEffect(() => { // Effect logic here return () => { // Cleanup logic here (like componentWillUnmount) }; }, [dependencies]);
4. ?? React ???
??? ??? ?? ?????.
-
React.createRef()
- ??? ?????? ??? ???? ? ?????.
-
React.forwardRef()
- ?? ?? ??? ??? ?????.
-
React.memo(????)
- props? ???? ?? ?? ????? ???? ?? ?? ?????.
-
React.lazy()
- ?? ?? ? ?? ?? ?? ??? ?????.
-
??.????
- React.lazy()? ?? ???? ??? ????? ???? ?? ??? ?????.
5. React ??? ??(????)
- useNavigate() (React Router v6)
- useParams()
- useLocation()
- useMatch()
?:
const value = useContext(MyContext);
6. Prop ?? ? ?? Prop
-
propType
- ????? ??? prop ??? ???? ? ?????.
-
defaultProps
- props? ???? ????? ?????.
?:
const [state, dispatch] = useReducer(reducer, initialState);
??
- ??? ????? ?? ????? ?? ?? ??? ?????.
- ??? ?? ??? ??? ???? ???? ?? ???? ?? ?? React ???? ????? ?????.
?? ?? ?? ??? ???? ???? ? ?? ??? ?? ??? ????, ? ???? ??? API? ?? ?? ??? ?????.
? ??? ??? ?? ?? || ????? ?? ?????. ??? ??? 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)

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? ????? ???? ?????.

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

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

.map (), .filter () ? .reduce ()? ?? JavaScript ?? ?? ???? ??? ??? ??? ? ? ????. 1) .map ()? ??? ??? ??? ???? ? ??? ???? ? ?????. 2) .filter ()? ???? ??? ????? ? ?????. 3) .reduce ()? ???? ?? ??? ???? ? ?????. ???? ??? ????? ??? ?? ?? ??? ?????.

JavaScript? ??? ??? ?? ??, ? ? ? ?? ???? ???? ??? ??? ?????. 1. ?? ??? ?? ??? ???? ??? ??? ??? ??? ?? WebAPI? ?????. 2. WebAPI? ??????? ??? ?? ? ? ??? ?? ??? (??? ?? ?? ???? ??)? ????. 3. ??? ??? ?? ??? ?? ??? ?????. ?? ??? ??? ????? ??? ??? ?? ? ???? ?????. 4. ???? ?? (? : Promise. 5. ??? ??? ???? ?? ???? ???? ?? ?? ?? ??? ????? ? ??????.

??? ??? ?? ???? ?? ??? ???? ?? ??? ??? ?? ??? ?? ??? ?????. 1. ??? ?? : ?? ??? ?? ? ? ???? ?? ??? ???? ??? ???? ??????. ?? ??, ??? ?? ? ? ?? ??? ?? ? ?? ??? ??????. 2. ??? ?? : ??? ???? ?? ?? ??? ?? ???? ????? ? ?? ?????? ???? ????? ? ?? ?? ??? true? ??????. 3. ?? ???? ?? ?? ??? ?? ??, ?? ??? ? ?? ???? ?????. 4. DOM ??? ???? ??, ?? ? ??? ? ??? ??? ?? ???? ?? ???? ?????.
