Posts Tagged #javascript
Every article on the Techalyst blog tagged with #javascript.
React Router: Routes, Params and Nested Layouts
React on its own has no concept of pages. The moment your app needs more than one screen with real URLs, back-button support, and shareable li...
JavaScript Array Methods and Vue Reactivity
Most of the work in a Vue app is shaping data before it hits the template. A list of products comes back from an API and you need the cheap on...
JavaScript Promises and async/await
JavaScript runs one line at a time, but network calls, timers, and file reads take time. Promises are how the language represents a value that...
Data Fetching in React with TanStack Query
Fetching data with useEffect works, but you end up writing the same things over and over: a loading flag, an error flag, a cleanup to ignore s...
Controlled vs Uncontrolled Components in React
Every form in React comes down to one question, and once you can answer it the rest falls into place: who owns the value in this input, React...
Closures and the Factory Pattern in JavaScript
Closures sound academic until you realise you use them constantly: every callback that remembers a variable, every module with private state,...
Memoisation in React: useMemo, useCallback and React.memo
React re-renders often, and that is fine, because a render is usually cheap. Memoisation is how you skip the renders and the calculations that...
useContext: Sharing State Without Prop Drilling
Prop drilling is the slow pain of passing a value down through layers of components that do not care about it, just to reach the one at the bo...
useReducer: Managing Complex State in React
useState is perfect for a few independent values. But when a component grows several pieces of state that change together, or transitions that...
Advanced Axios: Cancellation, Caching and Offline
Once you have a configured Axios instance, the next level is about responsiveness and resilience: cancelling requests that no longer matter, r...
Essential JavaScript Array Methods
Most day-to-day JavaScript is moving data through arrays: transforming it, filtering it, summing it, reshaping it. A handful of methods cover...
Arrow Functions and this in JavaScript
this is the part of JavaScript that quietly breaks more code than any other, and arrow functions are the tool that finally tamed it. The two a...
ES6 Modules: import and export
Before ES modules, splitting JavaScript across files meant leaky globals or awkward IIFE tricks. ES modules gave the language a real system: e...
Custom Hook Patterns and Best Practices in React
Writing a custom hook is easy. Writing one that stays clean as the app grows takes a few good habits. Rather than a list of tips, it helps to...
Custom Hooks: Extracting and Reusing Logic in React
The moment two components need the same stateful logic, fetching data, tracking the window size, a toggle with helpers, you feel the urge to c...
Props and Composition in React: children and Render Props
Components are only useful if they can talk to each other and slot together. React has a small, consistent set of tools for this: props send d...
The Rules of Hooks, and Why They Exist
There are two rules of hooks, and on first read they feel like arbitrary restrictions. Do not call hooks in conditions. Do not call them in lo...
Error Boundaries in React
By default, an uncaught error during rendering takes down your entire React app. One broken component throws, React unmounts the whole tree, a...
useState and How React Re-renders
useState is the first hook everyone learns, and on the surface it is simple: a value and a function to change it. What takes longer to click i...
useEffect: Effects, Cleanup and the Dependency Array
useEffect is the hook people reach for too often and understand too little. Its job is narrow: synchronise your component with something outsi...