Category React

All Categories

Select box component with React and TypeScript

January 21, 20234 min readReact

Learn how to create a reusable select box component with React and TypeScript.

Conditionally adding attributes and props in React

October 20, 20224 min readReact

Learn how to conditionally add attributes and props in your React components.

Pass style as a prop with React and TypeScript

October 10, 20222 min readReact

Learn how to add the correct TypeScript type for a style prop in React.

Build a context menu with React and TypeScript

October 01, 20226 min readReact

Learn how to use custom hooks and reusable React components to build a context menu.

How to use the React useState hook

September 23, 202212 min readReact

Learn how to manage local state in React components using the useState hook.

The React useState hook and lazy initialization

September 18, 20223 min readReact

Learn how to use an initializer function with useState for expensive state initialization.

Hooks versus container components in React

September 15, 20223 min readReact

Learn how hooks can be used to either replace container components or to live alongside them in a combined approach.

How to use the React useReducer hook

March 02, 20226 min readReact

Learn how to manage more complex state in React components using the useReducer hook.

Iterating and rendering data in React components

January 16, 20223 min readReact

Discover how to iterate and render data with React. Become a data looping expert with React components.

How to use the React useEffect hook

January 08, 20229 min readReact

Learn how to perform side-effects in components with the React useEffect hook.

How to use the React useRef hook

January 04, 20223 min readReact

Learn how to use the React useRef hook to access DOM elements and manage state.

Using the React useState hook for forms

January 04, 20223 min readReact

Learn how to use the React useState hook to manage form data.

function versus const for React components

January 02, 20224 min readReact

Learn the difference between declaring React components with either the function keyword or the const keyword and an arrow function.