The Callback That Re-rendered an Entire Table
A short debugging story about React.memo, prop drilling, and a missing useCallback.
The symptom
We had an editable table: one row per item, each row with a couple of text inputs. Every row component was wrapped in React.memo, specifically so that typing in one row wouldn’t force every other row to re-render. On a table with dozens of rows, that matters — otherwise every keystroke re-renders the whole table.
It didn’t work. Typing a single character in one row’s input made every row re-render, every time.
Making Impossible States Impossible with TypeScript Conditional Types
TypeScript is often introduced as a way to add static types to JavaScript. But its real power becomes visible when we stop describing only the shape of data and start modeling relationships between data.
A common challenge in software development is that some values are not independent. One value determines which other values are valid.
TypeScript can help us express these relationships directly in the type system — and prevent invalid states before our code ever runs.
Migrating from RestTemplate to RestClient in Spring Boot
Introduction
Since Spring Boot 3.2, RestTemplate has been deprecated in favor of the modern RestClient API. This migration guide explores why RestClient is the superior choice and demonstrates how to effectively replace RestTemplate in your existing codebase.
Why RestClient?
1. Modern Fluent API
RestClient provides a fluent, chainable API that significantly improves code readability:
Before (RestTemplate):
HttpEntity<RequestBody> entity = new HttpEntity<>(requestBody, headers);
ResponseEntity<ResponseObject[]> response = restTemplate.exchange(
url,
HttpMethod.POST,
entity,
ResponseObject[].class
);
ResponseObject[] data = response.getBody();
After (RestClient):