ReactJS SOLID Principle ~ DIP (Dependency Inversion Principle)~
typescript
dev.to
・The dependency that imports an extra module should depend on the abstract interface, but not the concrete one. Because this makes it easy to modify the application, while an application that depends on a concrete interface might collapse immediately. Here is an example using the swr. import useSWR from 'swr' const fetcher = async (url) => { const res = await fetch(url) return res.json() } export const Todo = () => { const { data } = useSWR('https://jsonplaceholder.typicode.com/todo