React.js Tutorials

Let's Sharpen Your React.js Skills

  1. How to Use a Map With React useState() Hook?

    Find out how to use the useState() hook with a JavaScript Map in React. Learn how to initialize, add/remove items, and render Map contents.
  2. How to Use a Set With React useState() Hook?

    Find out how to use the useState() hook with a JavaScript Set in React. Learn how to initialize, add/remove items, rendering Set contents, and the importance of immutability.
  3. How to Change/Update "args" in Storybook?

    Find out how you can update a component's "args" based on an action in Storybook. Knowing this will help you add control the state of your component while interacting with it in Storybook UI.
  4. How to Fix "Cannot assign to current because it is a read-only property" useRef() TypeScript Error?

    Find out why the TypeScript error "Cannot assign to current because it is a read-only property" happens and how to resolve it when using the useRef() React hook.
  5. How to Create Non-Flickering Dark/Light Mode Toggle in Next.js Using localStorage?

    Learn how to implement a seamless dark/light mode toggle in your Next.js application without the annoying flicker that often occurs during page load. This comprehensive guide covers step-by-step code to help you get started.
  6. How to Create Non-Flickering Dark/Light Mode Toggle in Next.js Using Cookies?

    Learn how to implement a seamless dark/light mode toggle in your Next.js application without the annoying flicker that often occurs during page load. This comprehensive guide covers step-by-step code to help you get started.
  7. What Are "Reactive Values" in React?

    Learn about the concept of "reactive" values in React. Knowing this will help you identify these values and correctly use them as dependencies in hooks such as useEffect().
  8. Are Primitive Values Recreated on Every Re-Render in React Functional Components?

    Find out if defining primitive values inside a React functional component can lead to unnecessary recreations on each re-render. Knowing this will help you improve the efficiency of your React applications.
  9. Are Arrays Inside React Functional Components Always Recreated on Re-Render?

    Find out if defining arrays inside a React functional component can lead to unnecessary array recreations on each re-render. Knowing this will help you improve the efficiency of your React applications.
  10. Are Objects Inside React Functional Components Always Recreated on Re-Render?

    Find out if defining objects inside a React functional component can lead to unnecessary object recreations on each re-render. Knowing this will help you improve the efficiency of your React applications.
  11. How to Fix "Property 'x' does not exist on type 'never'" TypeScript Error When Using React useRef()?

    Learn how to resolve the "Property 'value' does not exist on type 'never'" error when using React's useRef() with TypeScript. Discover the simple fix that ensures your code works seamlessly.
  12. How to Fix "Object is possibly 'null'" TypeScript Error When Using useRef React Hook?

    When using useRef(null) in React, TypeScript might complain about the reference object being null. In this post we will explain to you why this happens and how you can fix this error.