30 React.js & Redux Pro Tips That Made Me a Better Frontend
Thirty React and Redux tips for frontend work: understand rendering before APIs, not every re-render is a problem, and learn state management fundamentals.
This article is published in English.
Sources: 30 React.js & Redux Pro Tips That Made Me a Better Frontend Engineer
This walkthrough rebuilds the path from raw materials to a working system for: 30 React.js & Redux Pro Tips That Made Me a Better Frontend Engineer. The focus is operable steps, explicit checks, and code that you can drop into a repo without guessing intent. For the Overview stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion.
1. Stop Learning React APIs. Start Learning React Internals.
When working through the 1 Stop Learning React stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Treat effects as synchronization with the outside world, not as a substitute for derived values during render.
2. Every Re-render Is Not a Problem
When working through the 2 Every Re-render Is stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph. Treat effects as synchronization with the outside world, not as a substitute for derived values during render.
React.memo()
useMemo()
useCallback()
3. Learn State Management Before Learning Redux
When working through the 3 Learn State Management stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Treat effects as synchronization with the outside world, not as a substitute for derived values during render. When working through the 3 Learn State Management stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion.
const [isOpen, setIsOpen] = useState(false);
dispatch(openModal());
4. Redux Is Not a Database
The 4 Redux Is Not stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Keep render work cheap and push expensive derivation behind memoization only after measuring. Premature memo can hide stale props bugs.
5. Learn Redux Toolkit Properly
The 5 Learn Redux Toolkit stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph. Expose tools with narrow schemas and explicit side-effect labels. Hosts need to know which calls mutate state before they auto-approve.
const ADD_USER = "ADD_USER";
const usersSlice = createSlice({
name: "users",
initialState: [],
reducers: {
addUser(state, action) {
state.push(action.payload);
}
}
});
6. Separate Server State from Client State
The 6 Separate Server State stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Keep render work cheap and push expensive derivation behind memoization only after measuring. Premature memo can hide stale props bugs. The 6 Separate Server State stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion.
7. Learn React Query Before Your Next Project
For the 7 Learn React Query stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Colocate state with the component that owns the mutation. Lifting everything to a global store makes timing bugs harder to see.
dispatch(fetchUsers());
const { data, isLoading } = useQuery(...);
8. Stop Creating God Components
For the 8 Stop Creating God stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph. Colocate state with the component that owns the mutation. Lifting everything to a global store makes timing bugs harder to see.
Dashboard.jsx
9. Master Custom Hooks
For the 9 Master Custom Hooks stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Colocate state with the component that owns the mutation. Lifting everything to a global store makes timing bugs harder to see. For the 9 Master Custom Hooks stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion.
const Dashboard = () => {
// 300 lines of logic
}
const users = useUsers();
const filters = useFilters();
const permissions = usePermissions();
10. Stop Passing Props Through Five Levels
When working through the 10 Stop Passing Props stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Treat effects as synchronization with the outside world, not as a substitute for derived values during render.
<App>
<Layout>
<Page>
<Container>
<Widget>
<Button />
11. Learn Selectors Before Your Redux Store Becomes a Mess
When working through the 11 Learn Selectors Before stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph. Treat effects as synchronization with the outside world, not as a substitute for derived values during render.
const users = useSelector(state => state.users.data);
export const selectActiveUsers = (state) =>
state.users.filter(user => user.active);
12. Stop Storing Derived State
When working through the 12 Stop Storing Derived stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Treat effects as synchronization with the outside world, not as a substitute for derived values during render. When working through the 12 Stop Storing Derived stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion.
{
users: [...],
activeUsers: [...]
}
const activeUsers = users.filter(
user => user.active
);
13. Learn the React DevTools Profiler
The 13 Learn the React stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Expose tools with narrow schemas and explicit side-effect labels. Hosts need to know which calls mutate state before they auto-approve.
14. Avoid useEffect Whenever Possible
The 14 Avoid useEffect Whenever stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph. Keep render work cheap and push expensive derivation behind memoization only after measuring. Premature memo can hide stale props bugs.
useEffect(() => {
setFullName(
`${firstName} ${lastName}`
);
}, [firstName, lastName]);
const fullName =
`${firstName} ${lastName}`;
15. Don’t Fear Large Components. Fear Unclear Components.
The 15 Don t Fear stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Keep render work cheap and push expensive derivation behind memoization only after measuring. Premature memo can hide stale props bugs. The 15 Don t Fear stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion.
16. Learn Normalized State Structures
For the 16 Learn Normalized State stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Colocate state with the component that owns the mutation. Lifting everything to a global store makes timing bugs harder to see.
posts: [
{
id: 1,
comments: [...]
}
]
postsById: {}
commentsById: {}
17. Write Fewer Generic Components
For the 17 Write Fewer Generic stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph. Colocate state with the component that owns the mutation. Lifting everything to a global store makes timing bugs harder to see.
<UniversalTable />
<GenericCard />
<MegaForm />
18. Learn How JavaScript Closures Affect React
For the 18 Learn How JavaScript stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Colocate state with the component that owns the mutation. Lifting everything to a global store makes timing bugs harder to see. For the 18 Learn How JavaScript stage, define the inputs, the owner of the step, and the exit criteria before changing code. Operators should be able to re-run the step from a known checkpoint without guessing hidden state. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion.
useEffect(() => {
console.log(count);
}, []); //APS-1229
19. Start Thinking in Data Flow
When working through the 19 Start Thinking in stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Treat effects as synchronization with the outside world, not as a substitute for derived values during render.
20. Learn RTK Query
When working through the 20 Learn RTK Query stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Keep configuration outside application code. Environment files, secret stores, and feature flags belong in one place operators can audit without reading the whole graph. Treat effects as synchronization with the outside world, not as a substitute for derived values during render.
loading
error
success
retry
cache
21. Make TypeScript Your Best Friend
When working through the 21 Make TypeScript Your stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Document the happy path and the recovery path together. Retries, human gates, and dead-letter handling are part of the product, not later polish. Treat effects as synchronization with the outside world, not as a substitute for derived values during render. When working through the 21 Make TypeScript Your stage, write down the contract first: required inputs, success signal, and what happens on partial failure. That checklist keeps later code changes honest. Treat this stage as a contract between inputs and validated outputs. Name the artifacts, define success checks, and refuse silent partial completion.
type User = {
id: string;
name: string;
}
22. Read Popular Open Source React Codebases
The 22 Read Popular Open stage works best when treated as a measurable surface. Capture one golden transcript, one failure case, and the rollback note before expanding scope. Record timings and token or query cost next to functional results. Cost visibility early prevents surprise bills when the path moves from demo to shared environments. Keep render work cheap and push expensive derivation behind memoization only after measuring. Premature memo can hide stale props bugs.
23. Stop Creating Utility Files for Everything
utils.js
helpers.js
common.js
shared.js
24. Learn Accessibility Early
25. Understand React Suspense
26. Optimize Bundle Size Before It Becomes a Crisis
27. Learn Feature-Based Folder Structures
components/
hooks/
services/
utils/
features/
├─ users/
├─ dashboard/
├─ billing/