A Senior Web3 Frontend engineer sharing pieces of technology-related thought.
Immutable State Updates in React: Best Practices for Complex Objects
Got it — here’s your React useState Immutable Update Cheatsheet condensed into a single interview-friendly page: React useState Immutable Update Cheatsheet 1. Rule #1 — Immutability Never mutate the existing state object. Always return a new reference so React knows to re-render. 2. Shallow Updates (One-Level Objects) jsx コピーする 編集する const [user, setUser] = useState({ name: 'Alice', age: 25 }); setUser(prev => ({ ...prev, name: 'Bob' // update one property })); 3. Deep Updates (Nested Objects)...
Immutable State Updates in React: Best Practices for Complex Objects
Got it — here’s your React useState Immutable Update Cheatsheet condensed into a single interview-friendly page: React useState Immutable Update Cheatsheet 1. Rule #1 — Immutability Never mutate the existing state object. Always return a new reference so React knows to re-render. 2. Shallow Updates (One-Level Objects) jsx コピーする 編集する const [user, setUser] = useState({ name: 'Alice', age: 25 }); setUser(prev => ({ ...prev, name: 'Bob' // update one property })); 3. Deep Updates (Nested Objects)...
Redux和状态管理
https://aware-riddle-d41.notion.site/Redux-23c3a6da5c7280e8948ec1e378f66e58?pvs=73
Redux和状态管理
https://aware-riddle-d41.notion.site/Redux-23c3a6da5c7280e8948ec1e378f66e58?pvs=73
ReactQuery Example
import { QueryClient, QueryClientProvider, useQuery, } from '@tanstack/react-query' const queryClient = new QueryClient() export default function App() { return ( <QueryClientProvider client={queryClient}> <Example /> </QueryClientProvider> ) } function Example() { const { isPending, error, data } = useQuery({ queryKey: ['repoData'], queryFn: () => fetch('https://api.github.com/repos/TanStack/query').then((res) => res.json(), ), }) if (isPending) return 'Loading...' if (error) ...
ReactQuery Example
import { QueryClient, QueryClientProvider, useQuery, } from '@tanstack/react-query' const queryClient = new QueryClient() export default function App() { return ( <QueryClientProvider client={queryClient}> <Example /> </QueryClientProvider> ) } function Example() { const { isPending, error, data } = useQuery({ queryKey: ['repoData'], queryFn: () => fetch('https://api.github.com/repos/TanStack/query').then((res) => res.json(), ), }) if (isPending) return 'Loading...' if (error) ...
CeFi Problems
🔍 Brief Overview of Problems with Centralized Finance (CeFi)Now what I want to do is to give a very brief overview of some of the problems with centralized finance or CeFi. It's very brief because we will go through in much greater detail later in the course these problems one by one. But I want to introduce the problems. What's the reason for this? You've got a new technology. The new technology to be viable has to solve problems. It's not particularly useful to solve a ...
CeFi Problems
🔍 Brief Overview of Problems with Centralized Finance (CeFi)Now what I want to do is to give a very brief overview of some of the problems with centralized finance or CeFi. It's very brief because we will go through in much greater detail later in the course these problems one by one. But I want to introduce the problems. What's the reason for this? You've got a new technology. The new technology to be viable has to solve problems. It's not particularly useful to solve a ...