🌐
W3Schools
w3schools.com › react › react_es6_destructuring.asp
React ES6 Destructuring
In React, it's commonly used with props, hooks, and state management. Note: Destructuring makes React code cleaner and more readable by reducing repetitive object and array access.
🌐
GeeksforGeeks
geeksforgeeks.org › reactjs › destructuring-of-props-in-reactjs
Destructuring of Props in ReactJS - GeeksforGeeks
Destructuring in React simplifies code by extracting values from props or state, assigning them to variables for clearer and more readable code. Destructuring can be done using hte props, extraction, and reassinging methods.
Published   July 23, 2025
Discussions

Best way for destructuring props in React
First method is preffered and widely used in real development. More on reddit.com
🌐 r/reactjs
11
2
April 18, 2023
How to Object destructuring in child component in REACT
What is the problem with Object destructuring in REACT here? Check the CODEPEN HERE The same destructuring works outside React. How can I send object as an argument and have a parameterized destruc... More on stackoverflow.com
🌐 stackoverflow.com
Destructuring state/props in React - javascript
I'm learning React and I have Eslint installed in my project. It started giving me errors like Use callback in setState when referencing the previous state. (react/no-access-state-in-setstate) Mu... More on stackoverflow.com
🌐 stackoverflow.com
What is the point of always destructuring?
I've applied destructuring variables to some old components in my code and it looks a lot cleaner. It's overkill for a single variable, but on the other hand, makes it super easy to add more variables as your component grows. Destructuring at the top of your lifecycle functions makes it easier to refactor/rename in the future. More on reddit.com
🌐 r/javascript
26
27
November 12, 2018
🌐
Medium
medium.com › @lcriswell › destructuring-props-in-react-b1c295005ce0
Destructuring Props in React. When I first learned about… | by Lindsay Criswell | Medium
May 20, 2018 - Destructuring really shines in React apps, where it can greatly simplify how you write props. Take for example an <Attraction />component from a travel app I built.
🌐
W3Schools
w3schools.com › react › react_props_destructuring.asp
React Destructuring Props
React Compiler React Quiz React Exercises React Syllabus React Study Plan React Server React Interview Prep React Bootcamp ... You can limit the properties a component receives by using destructuring.
🌐
Medium
medium.com › @abdoessamadhmayda › destructuring-props-and-state-in-react-a-comprehensive-guide-53eb7598adc4
Destructuring Props and State in React: A Comprehensive Guide | by Abdoessamadhmayda | Medium
September 9, 2024 - Destructuring is a powerful syntactic ... to new variables. In React, destructuring is widely used to simplify the process of accessing and using props and state within components....
🌐
DhiWise
dhiwise.com › post › component-development-with-react-destructuring-props
React Destructuring Props Made Easy
April 30, 2025 - When you destructure props in a functional component, you use ES6 syntax to make your code more concise and readable. This is particularly useful in a React application where components can receive many props, and you want to maintain clarity.
🌐
freeCodeCamp
freecodecamp.org › news › the-basics-of-destructuring-props-in-react-a196696f5477
Learn the basics of destructuring props in React
May 1, 2018 - This is a huge upside in React when you’re passing down props. Once you take the time to destructure your props, you can get rid of props / this.props in front of each prop.
🌐
Reddit
reddit.com › r/reactjs › best way for destructuring props in react
r/reactjs on Reddit: Best way for destructuring props in React
April 18, 2023 -

I was wondering if there is any difference between this two ways of destructuring props

const Component = ({prop1, prop2}) => { ... }
const Component = (props) => {
  const {prop1, prop2} = props;
  ...
}

Is there any advantage or disadvantage on choosing one over the other? Could you run into rerendering issues in the second option because it creates a new variable on each render (if the prop is an object or an array)?

Find elsewhere
🌐
DEV Community
dev.to › thelogicwarlock › efficient-use-of-javascript-object-and-array-destructuring-in-react-55l9
Efficient use of JavaScript Object and Array Destructuring in React - DEV Community
February 21, 2025 - In the JavaScript and React world, object and array destructuring are powerful features that allow developers to extract data from arrays or objects into distinct variables. This is particularly useful when dealing with complex state objects ...
🌐
Kent C. Dodds
kentcdodds.com › blog › react-hooks-array-destructuring-fundamentals
React Hooks: Array Destructuring Fundamentals
Ok, interesting, so useReducer is actually over 100 lines of code, so let's just look at what useReducer returns: ... See! It's an array! So when we call useState, it returns a call to useReducer which will return an array of two values. This allows us to do the array destructuring that we want so instead of writing:
🌐
DEV Community
dev.to › angski › destructuring-props-in-react-4hfc
Destructuring props in React - DEV Community
April 28, 2023 - Instead of using props.prop1 and props.prop2, we can use destructuring to extract the values of these properties and assign them to variables of the same name.
🌐
Medium
medium.com › @Producdevity › breaking-the-habit-the-overuse-of-object-destructuring-in-react-5404ab53eb6d
Breaking the Habit: The Overuse of Object Destructuring in React | by Yassine Gherbi | Producdevity | Medium
October 5, 2023 - Loss of Context: Props in React components offer a meaningful context about the origin and relation of a variable or function. By destructuring props, we’re stripping away this context. The explicit association of a variable to a component, like props.title, provides clear context.
🌐
Juno College
junocollege.com › blog › react-destructuring-techniques
React Destructuring Techniques | Juno College
When working in React, it is common practice to unpack a couple values from props or state into their own distinct variables: ... Mainly, this was so we can improve our app readability by not always having to write out something like this.props.name and instead simply writing name. This level of destructuring is perfect for when the amount of data that you’re working with isn’t overly complex.
🌐
TutorialsPoint
tutorialspoint.com › destructuring-of-props-in-reactjs
Destructuring of Props in ReactJS
July 26, 2023 - We'll then delve into the concept of destructuring props in ReactJS, which is a technique used to extract specific values from the props object and use them as standalone variables in a component.
Top answer
1 of 3
24

What eslint is telling you with the react/destructuring-assignments error is that assignments like:

const data = this.state.data;

can be rewritten into:

const { data } = this.state;

This also works for function arguments, so:

onChange = e => { ... }

can be written as

onChange = ({target: {value, name}}) => { ... }

The next error for react/no-access-state-in-setstate tells you that you are writing:

this.setState({
    data: { ...this.state.data, [e.target.name]: e.target.value }
});

when you should be writing:

this.setState(prevState => ({
    data: { ...prevState.data, [e.target.name]: e.target.value }
}));

or, if you combine it with the react/destructuring-assignments rule:

onChange = ({target: {name, value}}) =>
    this.setState(prevState => ({
        data: { ...prevState.data, [name]: value }
    }));

You can read more about those two rules here:

react/destructuring-assignment

react/no-access-state-in-setstate

2 of 3
5

Destructuring is basically syntatic sugar Some Eslint configurations prefer it (which I'm guessing is your case).

It's basically declaring the values and making them equal to the bit of syntax you don't want to repeat, for Ex, given react props:

this.props.house, this.props.dog, this.props.car

destructured --->

 const { house, dog, car } = this.props;

So now you can just use house, or dog or whatever you want. It's commonly used with states and props in react, here is more doc about it, hope it helps. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

🌐
freeCodeCamp
freecodecamp.org › news › destructure-object-properties-using-array-map-in-react
How to Destructure Object Properties Using array.map() in React
November 2, 2022 - But, when you destructure the properties in that object, the syntax looks somewhat like this: employeesData.map( ({ name, address, attributes: { height, hairColor, eye }, gender }, index) => { return name, address, height, hairColor, eye } ) The snippet above eliminates the process of doing this: employee.name, employee.attributes.height, and so on. Now, that you have an idea of how it works, it is time to place this .map() into a React component, then return the corresponding properties.
🌐
Medium
medium.com › @JavaScript-World › es6-destructuring-in-react-js-cc83ec2a0d42
ES6 Destructuring in React.js. One of the most practical ES6 features… | by JavaScript-World | Medium
May 22, 2023 - In the second version of the Greeting component, we use destructuring directly in the function parameter. This makes the code cleaner and eliminates the need to use props. each time we want to access a property. Another common use case in React.js is destructuring the state in functional components when using the useState hook:
🌐
Munnelly
munnelly.com › backend › lessons › array-object-destructuring
Destructuring in JavaScript | React.js Tutorials
Array destructuring enables developers to unpack values from arrays and assign them to variables in a more concise and readable manner. When working with hooks such as useState in React.js, array destructuring becomes especially handy.
🌐
C# Corner
c-sharpcorner.com › article › destructuring-and-event-handler-in-react
Destructuring And Event Handler In React
March 5, 2024 - Destructuring is a simple concept introduced in React ES6. It is a JavaScript feature that allows users to extract multiple pieces of data from an array or object and assign them to their own variable.