Skip to Content
Nextra 4.0 is released πŸŽ‰

πŸ§‘β€πŸ’» νŒ¨ν‚€μ§€ μ‚¬μš©ν•˜κΈ°

λ‹€λ₯Έ μ›Œν¬μŠ€νŽ˜μ΄μŠ€μ—μ„œ νŒ¨ν‚€μ§€λ₯Ό μ‚¬μš©ν•˜λ €λ©΄, λ‹€μŒκ³Ό 같은 단계λ₯Ό λ”°λ₯΄μ„Έμš”:

βž• μ˜μ‘΄μ„± μΆ”κ°€

λ¨Όμ € ν•΄λ‹Ή μ›Œν¬μŠ€νŽ˜μ΄μŠ€μ˜ package.json νŒŒμΌμ— μ˜μ‘΄μ„±μ„ μΆ”κ°€ν•΄μ•Ό ν•©λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, @repo/react-utils νŒ¨ν‚€μ§€λ₯Ό μ‚¬μš©ν•˜λ €λ©΄ λ‹€μŒκ³Ό 같이 μž‘μ„±ν•©λ‹ˆλ‹€:

{ "dependencies": { "@repo/react-utils": "workspace:*" } }

그리고 μ˜μ‘΄μ„±μ„ μ„€μΉ˜ν•©λ‹ˆλ‹€:

cd path/to/project/root pnpm install

πŸ§‘β€πŸ’»οΈ μ‚¬μš© μ˜ˆμ‹œ

이제 νŒ¨ν‚€μ§€λ₯Ό μž„ν¬νŠΈν•˜μ—¬ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. 예λ₯Ό λ“€μ–΄, @repo/react-utils νŒ¨ν‚€μ§€μ—μ„œ μ œκ³΅ν•˜λŠ” useInterval 훅을 μ‚¬μš©ν•˜λŠ” μ˜ˆμ‹œλŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€:

apps/web/containers/AutoCounter/index.tsx
"use client"; import { type FC, useReducer } from "react"; import { useInterval } from "@repo/react-utils/hooks"; const AutoCounter: FC = () => { const [counter, increase] = useReducer((state: number) => state + 1, 0); useInterval(increase, 1_000); return <>{counter}</>; }; export default AutoCounter;

Last updated on