UI Development
React
Published articles in UI Development / React.
More articles in this area
React forwardRef with TypeScript
import {HTMLAttributes, FC, forwardRef} from 'react' interface Props extends HTMLAttributes<HTMLDivElement> { } export const PageCover = forwardRef<HTMLDivElement, Props>((props, ref) => { return (…
Grouping React components in surrounding components
Let's assume you have an array of data:
Use useRef to fix React state update on unmounted component
When React tries to set state on a component that has been unmounted from the DOM you get that error:
React with Recoil state management
Add RecoilRoot to your root component
React and rerendering
A functional component will refresh any time it receives new props, more precisely if its old and new props fail a referential identity check.
QuickStart: React with TypeScript
You need Node >= 10.16 and npm >= 5.6 .
React hooks
React hooks are a new way to enhance your React Functional Components, for example to let them handle state or reference DOM elements. Before hooks were introduced the only way to achieve this was to…