React

React ๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ TypeScript์™€ Hooks ์‚ฌ์šฉ ํŒ ๋ฐ ์˜ˆ์ œ

martinooo 2024. 8. 8. 10:40

๋ฆฌ์•กํŠธ

 

 

 

 

๐Ÿคท‍โ™‚๏ธ ๋ฆฌ์•กํŠธ์™€ ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์กฐํ•ฉ


React์™€ Typescript๋Š” ๊ฐ•๋ ฅํ•œ ์กฐํ•ฉ์œผ๋กœ ์ฝ”๋“œ ๋ฒ ์ด์Šค๋ฅผ ๋”์šฑ ์•ˆ์ „ํ•˜๊ณ  ์œ ์ง€๋ณด์ˆ˜ํ•˜๊ธฐ ์‰ฌ์šด ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

ํ•˜์ง€๋งŒ ์ž…๋ฌธ์ž ๋ถ„๋“ค๊ป˜์„œ๋Š” React hook์— Typescript๋ฅผ ์ •์˜ํ•˜๋Š” ๊ฒŒ ๋ถˆํŽธํ•˜๊ณ  ๊นŒ๋‹ค๋กœ์šธ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์ด ๊ธ€์„ ํ†ตํ•ด์„œ useState, useEffect, useContext, useRef ๊ทธ๋ฆฌ๊ณ  Custom Hook์—์„œ Typescript๋ฅผ ์ •์˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์ž์„ธํžˆ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

 

React Hook ์‚ฌ์šฉ๊ฐœ๋…๋ณด๋‹ค๋Š” TypeScript๋ฅผ ์ •์˜ํ•˜๊ณ  ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์ž์„ธํžˆ ๋‹ค๋ฃจ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.

 

 

 

2024.07.31 - [React] - ๋ฆฌ์•กํŠธ useLayoutEffect ๊ฐœ๋… ๋ฐ ์‚ฌ์šฉ๋ฒ•

 

๋ฆฌ์•กํŠธ useLayoutEffect ๊ฐœ๋…๋ฐ ์‚ฌ์šฉ๋ฒ•

๐Ÿคท‍โ™‚๏ธ Rendering๋ž€?useLayoutEffect์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ณด๊ธฐ ์ „์— ๋ฆฌ์•กํŠธ์—์„œ ๊ฐ€์žฅ ์ค‘์š”ํ•œ ๋ Œ๋”๋ง ๊ณผ์ • ๊ฐ„๋‹จํ•˜๊ฒŒ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ Œ๋”๋ง(Rendering)์ด๋ž€?์‰ฝ๊ฒŒ ์„ค๋ช…ํ•ด์„œ HTML, CSS, JavaScript ๋ฌธ์„œ๋ฅผ ์ฝ๊ณ  ๋ธŒ๋ผ

cometruedream.tistory.com

 

2024.08.02 - [React] - ๋ฆฌ์•กํŠธ ์ œ์–ด vs ๋น„์ œ์–ด ์ปดํฌ๋„ŒํŠธ ์•Œ์•„๋ณด๊ธฐ

 

๋ฆฌ์•กํŠธ ์ œ์–ด vs ๋น„์ œ์–ด ์ปดํฌ๋„ŒํŠธ ์•Œ์•„๋ณด๊ธฐ

๐Ÿคท‍โ™‚๏ธ ๋ฆฌ์•กํŠธ ํผ ์š”์†Œ๋ž€?๋ฆฌ์•กํŠธ์—์„œ ํผ(form) ์š”์†Œ์— ์ƒํƒœ๊ฐ’์„ ๋‹ค๋ฃจ๋Š” ๋ฐฉ์‹์— ๋”ฐ๋ผ ์ œ์–ด ์ปดํฌ๋„ŒํŠธ(controlled component)์™€ ๋น„์ œ์–ด ์ปดํฌ๋„ŒํŠธ(uncontrolled component) ๋ฐฉ์‹์œผ๋กœ ๋‚˜๋ˆ ์ง‘๋‹ˆ๋‹ค. ์ด ๋‘ ๊ฐ€์ง€ ์ ‘

cometruedream.tistory.com

๐Ÿคท‍โ™‚๏ธ React Hooks์™€ Typescript ์‹ค์ „ ์˜ˆ์ œ


 

useState์™€ TypeScript

useState๋Š” ์ปดํฌ๋„ŒํŠธ์˜ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๊ฐ€์žฅ ๊ธฐ๋ณธ์ ์ธ Hook์ž…๋‹ˆ๋‹ค.

TypeScript๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ƒํƒœ์˜ ํƒ€์ž…์„ ๋ช…์‹œ์ ์œผ๋กœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

๊ธฐ๋ณธ ์˜ˆ์ œ

useState๋ฅผ ์‚ฌ์šฉํ•  ๋•Œ ํƒ€์ž…์„ ๋ช…์‹œ์ ์œผ๋กœ ์ง€์ •ํ•˜๋ฉด ์ƒํƒœ์˜ ํƒ€์ž… ์•ˆ์ •์„ฑ์„ ๋ณด์žฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, ์ˆซ์ž ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•  ๋•Œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค

import React, { useState } from 'react';

const CounterComponent: React.FC = () => {
  const [count, setCount] = useState<number>(0);

  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={() => setCount(count + 1)}>Increment</button>
    </div>
  );
};

export default CounterComponent;

 

๋ฌธ์ž์—ด ์ƒํƒœ ๊ด€๋ฆฌ

๋ฌธ์ž์—ด ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•  ๋•Œ๋„ ํƒ€์ž…์„ ๋ช…์‹œ์ ์œผ๋กœ ์ง€์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

import React, { useState } from 'react';

const TextComponent: React.FC = () => {
  const [text, setText] = useState<string>('');

  return (
    <div>
      <input
        type="text"
        value={text}
        onChange={(e) => setText(e.target.value)}
      />
      <p>{text}</p>
    </div>
  );
};

export default TextComponent;

 

๊ฐ์ฒด ์ƒํƒœ ๊ด€๋ฆฌ

๋ณต์žกํ•œ ๊ฐ์ฒด ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•  ๋•Œ๋Š” ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ์ •์˜ํ•˜์—ฌ ํƒ€์ž…์„ ๋ช…์‹œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

import React, { useState } from 'react';

interface User {
  name: string;
  age: number;
}

const UserComponent: React.FC = () => {
  const [user, setUser] = useState<User>({ name: 'John', age: 30 });

  return (
    <div>
      <p>User: {user.name}, Age: {user.age}</p>
      <button onClick={() => setUser({ ...user, age: user.age + 1 })}>Increase Age</button>
    </div>
  );
};

export default UserComponent;

 

useEffect์™€ TypeScript

useEffect๋Š” ๋ถ€์ˆ˜ ํšจ๊ณผ(์‚ฌ์ด๋“œ ์ดํŽ™ํŠธ)๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

์˜ˆ๋ฅผ ๋“ค์–ด, ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ, ๊ตฌ๋… ์„ค์ •, ์ˆ˜๋™์œผ๋กœ DOM ๋ณ€๊ฒฝ ๋“ฑ์„ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

 

์ฒซ ๋ Œ๋”๋ง์— ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ ์˜ˆ์ œ

๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ฌ ๋•Œ useEffect๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋งˆ์šดํŠธ ๋  ๋•Œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๊ณ , ์–ธ๋งˆ์šดํŠธ๋  ๋•Œ ์ •๋ฆฌ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

import React, { useEffect, useState } from 'react';

const DataFetchingComponent: React.FC = () => {
  const [data, setData] = useState<string | null>(null);

  useEffect(() => {
    fetch('https://api.example.com/data')
      .then(response => response.json())
      .then(data => setData(data))
      .catch(error => console.error('Error fetching data:', error));

    return () => {
      console.log('Cleanup on unmount');
    };
  }, []); // ๋นˆ ๋ฐฐ์—ด์€ ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋งˆ์šดํŠธ๋  ๋•Œ ํ•œ ๋ฒˆ๋งŒ ์‹คํ–‰

  return (
    <div>
      {data ? <p>Data: {data}</p> : <p>Loading...</p>}
    </div>
  );
};

export default DataFetchingComponent;
 

useContext์™€ TypeScript

useContext๋Š” Context API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ „์—ญ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

Context๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์—ฌ๋Ÿฌ ์ปดํฌ๋„ŒํŠธ์—์„œ ์ƒํƒœ๋ฅผ ๊ณต์œ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์˜ˆ์ œ

์ „์—ญ ์ƒํƒœ๋ฅผ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด Context๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ์ด๋ฅผ Provider์™€ Consumer๋ฅผ ํ†ตํ•ด ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

import React, { useContext, createContext, useState } from 'react';

// ์‚ฌ์šฉ์ž ์ธํ„ฐํŽ˜์ด์Šค ์ •์˜
interface User {
  name: string;
  age: number;
}

// Context ์ƒ์„ฑ
const UserContext = createContext<User | null>(null);

const UserProvider: React.FC = ({ children }) => {
  const [user, setUser] = useState<User>({ name: 'John', age: 30 });

  return (
    <UserContext.Provider value={user}>
      {children}
    </UserContext.Provider>
  );
};

const UserProfile: React.FC = () => {
  const user = useContext(UserContext);

  return (
    <div>
      {user ? <p>{user.name}, {user.age}</p> : <p>No user data</p>}
    </div>
  );
};

const App: React.FC = () => (
  <UserProvider>
    <UserProfile />
  </UserProvider>
);

export default App;

 

useRef์™€ TypeScript

useRef๋Š” DOM ์š”์†Œ๋‚˜ ๋‹ค๋ฅธ ๊ฐ’์„ ์ฐธ์กฐํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

์ฃผ๋กœ ํฌ์ปค์Šค ์„ค์ •์ด๋‚˜ ๋‹ค๋ฅธ DOM ์กฐ์ž‘์„ ์œ„ํ•ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.

 

์˜ˆ์ œ

useRef๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ž…๋ ฅ ์š”์†Œ์— ํฌ์ปค์Šค๋ฅผ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค

import React, { useRef, useEffect } from 'react';

const FocusInputComponent: React.FC = () => {
  const inputRef = useRef<HTMLInputElement>(null);

  useEffect(() => {
    if (inputRef.current) {
      inputRef.current.focus();
    }
  }, []);

  return <input ref={inputRef} type="text" />;
};

export default FocusInputComponent;

 

Custom Hook๊ณผ TypeScript

Custom Hook์„ ์‚ฌ์šฉํ•˜๋ฉด ์žฌ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋กœ์ง์„ ๋ถ„๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Custom Hook์€ ์ผ๋ฐ˜ ํ•จ์ˆ˜์ฒ˜๋Ÿผ ๋™์ž‘ํ•˜๋ฉฐ, ๋‹ค๋ฅธ Hook์„ ๋‚ด๋ถ€์—์„œ ํ˜ธ์ถœํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์˜ˆ์ œ

๋‹ค์Œ ์˜ˆ์ œ์—์„œ๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” Custom Hook์„ ์ •์˜ํ•˜๊ณ , ์ด๋ฅผ ์ปดํฌ๋„ŒํŠธ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค

import { useState, useEffect } from 'react';

const useFetch = <T,>(url: string): { data: T | null; loading: boolean } => {
  const [data, setData] = useState<T | null>(null);
  const [loading, setLoading] = useState<boolean>(true);

  useEffect(() => {
    fetch(url)
      .then(response => response.json())
      .then(data => {
        setData(data);
        setLoading(false);
      })
      .catch(error => {
        console.error('Error fetching data:', error);
        setLoading(false);
      });
  }, [url]);

  return { data, loading };
};

// ์‚ฌ์šฉ ์˜ˆ์ œ
import React from 'react';

interface UserData {
  id: number;
  name: string;
}

const UserFetchComponent: React.FC = () => {
  const { data, loading } = useFetch<UserData>('https://api.example.com/user');

  return (
    <div>
      {loading ? <p>Loading...</p> : data ? <p>{data.name}</p> : <p>No Data</p>}
    </div>
  );
};

export default UserFetchComponent;

 

๐Ÿคท‍โ™‚๏ธ React ๊ฐœ๋ฐœ์ž๋ฅผ ์œ„ํ•œ TypeScript์™€ Hooks ์‚ฌ์šฉ ํŒ ๋ฐ ์˜ˆ์ œ ๋งˆ์ง€๋ง‰์œผ๋กœ


๋ฆฌ์•กํŠธ ํ›…์„ ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ์™€ ํ•จ๊ป˜ ์‚ฌ์šฉํ•˜๋ฉด ์ฝ”๋“œ์˜ ํƒ€์ž… ์•ˆ์ „์„ฑ์„ ๋†’์ด๊ณ  ์œ ์ง€๋ณด์ˆ˜์„ฑ์„ ๊ฐœ์„ ํ•ฉ๋‹ˆ๋‹ค.

๋ฐ˜๋Œ€๋กœ, ํƒ€์ž… ์•ˆ์ „์„ฑ์„ ๋†’์ด๊ณ  ์œ ์ง€ ๋ณด์ˆ˜์„ฑ์„ ๋†’์ด๋ ค๋ฉด ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ž˜ ๋‹ค๋ค„์•ผ ํ•˜๋ฉฐ ๋งŽ์€ ๊ณต๋ถ€๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

 

์ด ๊ธ€์—์„œ ๊ธฐ๋ณธ์ ์ธ ๋ฆฌ์•กํŠธ ํ›… useState, useEffect, useContext, useRef ๊ทธ๋ฆฌ๊ณ  Custom Hook์— ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ •์˜ํ•˜๊ณ  ํƒ€์ž… ์•ˆ์ •์„ฑ๊ณผ ์œ ์ง€๋ณด์ˆ˜์„ฑ์„ ๋†’์ด๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด์„œ ์•Œ์•„๋ดค์Šต๋‹ˆ๋‹ค.

 

 

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๋ฟŒ์‹œ๊ธฐ

https://itibiza.tistory.com/entry/%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8-%EC%8B%9C%EB%A6%AC%EC%A6%88-javascript-%ED%95%A8%EC%88%98-%EC%8A%A4%EC%BD%94%ED%94%84-%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0

 

[์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์‹œ๋ฆฌ์ฆˆ] javascript ํ•จ์ˆ˜ ์Šค์ฝ”ํ”„ ์ดํ•ดํ•˜๊ธฐ

๋ณธ๋ก ์— ์•ž์„œ์•ˆ๋…•ํ•˜์„ธ์š”! ์ด๊ธ€์—์„œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์‹œ๋ฆฌ์ฆˆ - javascript ์Šค์ฝ”ํ”„์˜ ๊ฐœ๋…๊ณผ ์˜ˆ์ œ ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ(javascript)๋Š” ๋™์  ์ธํ„ฐํ”„๋ฆฌํ„ฐ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด์ด๊ธฐ ๋•Œ๋ฌธ์— ๋‹ค๋ฅธ ์ „ํ†ต์ 

itibiza.tistory.com

 


 

์žฌ๋ฐŒ๋Š” ์˜ค๋Š˜์˜ ๋ ๋ณ„ ์šด์„ธ ๋ณด๊ณ  ๊ฐ€์„ธ์š”! 

 

 

https://cometruedream.tistory.com/247

 

[React] Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผ className ์ปค์Šคํ…€

๐Ÿคท‍โ™‚๏ธ Tailwind ํ•œ์ค„, ๋‘์ค„, ์„ธ์ค„ ํšจ๊ณผํ”„๋กœ์ ํŠธ ์ง„ํ–‰์ค‘ ๋ฐฐ๋„ˆ ๋งํฌ์— URL ๊ธธ์ด๊ฐ€ ๋„ˆ๋ฌด ๊ธธ์–ด์„œ 3์ค„ ํšจ๊ณผ ์ฒ˜๋ฆฌ๋ฅผ ํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค. React + Tailwind CSS ์…‹ํŒ…๋œ ํ”„๋กœ์ ํŠธ ์—ฌ์„œ CSS ํŒŒ์ผ & style ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/243

 

NestJS Lifecycle (์ƒ๋ช…์ฃผ๊ธฐ) ๊ฐœ๋…

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œ Nest JS ๊ฐœ๋…?Nest JS๋Š” Node JS ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ํ”„๋ ˆ์ž„์›Œํฌ ์ž…๋‹ˆ๋‹ค. ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ๋Š” ์ƒ๋‹นํžˆ ์˜ค๋žซ๋™์•ˆ Express ๊ธฐ๋ฐ˜์œผ๋กœ ์„œ๋ฒ„ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ๊ฐœ๋ฐœ์—์„œ ์••๋„์ ์ธ ์ 

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/242

 

๋ฆฌ์•กํŠธ Vite Proxy ํ™œ์šฉํ•œ CORS ์˜ค๋ฅ˜ ํ•ด๊ฒฐ

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋ก ํŠธ์—”๋“œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ต์— ๋Œ€ํ•ด์„œ ๊ณต๋ถ€๋ฅผ ํ•˜๊ณ  ๊ธ€์„ ๋ณด์‹œ๋ฉด ๋” ๋งŽ์€ ๋„์›€์ด ๋ฉ๋‹ˆ๋‹ค^^ํ”„๋ก ํŠธ์—”๋“œ ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ๋ฒˆ๋“ค๋Ÿฌ ๊ฐœ๋…๊ณผ webpack vs vite ๋น„๊ตhttps://comet

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/241

 

React ํด๋”๊ตฌ์กฐ FSD ๊ธฐ๋Šฅ ๋ถ„ํ™œ ์„ค๊ณ„ ์•„ํ‚คํ…์ฒ˜

๐Ÿคท‍โ™‚๏ธ ๋ณธ๋ก ์— ์•ž์„œํ”„๋กœ์ ํŠธ๋ฅผ ์‹œ์ž‘ํ•˜๊ธฐ์— ์•ž์„œ ํด๋” ๊ตฌ์กฐ, ์„ค๊ณ„์— ๋Œ€ํ•œ ์•„ํ‚คํ…์ฒ˜๋ฅผ ๋งŒ๋“œ๋Š” ๊ฒƒ์€ ์ƒ๋‹นํžˆ ์–ด๋ ต๋‹ค. ์ด๋ฒˆ ํ”„๋กœ์ ํŠธ์— React FSD ํด๋”๊ตฌ์กฐ ์•„ํ‚คํ…์ฒ˜๋ฅผ ์„ค๊ณ„ํ•  ์˜ˆ์ •์ด๋ผ์„œ FSD ์•„ํ‚คํ…

cometruedream.tistory.com

 

 

https://cometruedream.tistory.com/244

 

์‰ฝ๊ฒŒ ์ดํ•ดํ•˜๊ณ  ์‚ฌ์šฉํ• ์ˆ˜ ์žˆ๋Š” Prisma ๋ช…๋ น์–ด ์ •๋ฆฌ

๐Ÿคท‍โ™‚๏ธ Prisma ๋ช…๋ น์–ด ๋ณธ๋ก ์— ์•ž์„œ Prisma๋ž€?Nest JS ํ”„๋ ˆ์ž„์›Œํฌ์™€ Prisma ORM์„ ํ™œ์šฉํ•ด์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•˜๋ฉด์„œ Prisma๋Š” Node JS ๊ธฐ๋ฐ˜์— ํ”„๋ ˆ์ž„์›Œํฌ/๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ์ƒํ˜ธ์ž‘์šฉ์ด ์ž˜๋˜๋ฉฐ Prisma + DB ์—ฐ๋™์œผ

cometruedream.tistory.com